+2014-11-28 Achim Gratz <Stromeko@NexGo.DE>
+
+ * script.cc: New static string dash.
+ (init_run_script): Initialize dash.
+ (run): Implement dash as an extra shell type that is invoked for
+ suffix ".dash". Implement suffix ".cmd" as an alias for ".bat".
+
2014-11-28 Achim Gratz <Stromeko@NexGo.DE>
* install.cc (do_install_thread): Remove initialization for
#endif
#endif
-static std::string sh;
+static std::string sh, dash;
static const char *cmd;
static void
SetEnvironmentVariable ("TERM", "dumb");
SetEnvironmentVariable ("TMP", "/tmp");
- sh = backslash (cygpath ("/bin/bash.exe"));
- cmd = "cmd.exe";
+ sh = backslash (cygpath ("/bin/bash.exe"));
+ dash = backslash (cygpath ("/bin/dash.exe"));
+ cmd = "cmd.exe";
}
class OutputLog
sprintf (cmdline, "%s %s \"%s\"", sh.c_str(), "--norc --noprofile", scriptName.c_str());
retval = ::run (cmdline);
}
- else if (cmd && ("bat" == scriptExtension))
+ else if (dash.size() && ("dash" == scriptExtension))
+ {
+ sprintf (cmdline, "%s \"%s\"", dash.c_str(), scriptName.c_str());
+ retval = ::run (cmdline);
+ }
+ else if (cmd && (("bat" == scriptExtension) ||
+ ("cmd" == scriptExtension)))
{
sprintf (cmdline, "%s %s \"%s\"", cmd, "/c", windowsName.c_str());
retval = ::run (cmdline);