From 88ecc0fdb3d34c31421e32d582f8b9782b14dcbb Mon Sep 17 00:00:00 2001 From: Uwe Stieber Date: Fri, 19 Sep 2014 10:09:20 +0200 Subject: Terminals: Add startup initializer on Windows to add default "Git Bash" entry --- .../plugin.xml | 5 ++ .../showin/ExternalExecutablesInitializer.java | 87 ++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.local/src/org/eclipse/tcf/te/ui/terminals/local/showin/ExternalExecutablesInitializer.java (limited to 'target_explorer') diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.local/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.local/plugin.xml index 5f1997bba..fc7fbbbd0 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.local/plugin.xml +++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.terminals.local/plugin.xml @@ -117,6 +117,11 @@ + + + + + > l = ExternalExecutablesManager.load(); + if (l == null) l = new ArrayList>(); + // Find a entry labeled "Git Bash" + Map m = null; + for (Map candidate : l) { + String name = (String) candidate.get(IExternalExecutablesProperties.PROP_NAME); + if ("Git Bash".equals(name)) { //$NON-NLS-1$ + m = candidate; + break; + } + } + + if (m == null) { + m = new HashMap(); + m.put(IExternalExecutablesProperties.PROP_NAME, "Git Bash"); //$NON-NLS-1$ + m.put(IExternalExecutablesProperties.PROP_PATH, gitPath); + m.put(IExternalExecutablesProperties.PROP_ARGS, "--login -i"); //$NON-NLS-1$ + if (iconPath != null) m.put(IExternalExecutablesProperties.PROP_ICON, iconPath); + + l.add(m); + ExternalExecutablesManager.save(l); + } + } + } + } +} -- cgit v1.2.3