]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
add dash as a usable script type and shell, add ".cmd" as an alias for ".bat"
authorAchim Gratz <Stromeko@NexGo.DE>
Sat, 6 Dec 2014 13:52:49 +0000 (13:52 +0000)
committerAchim Gratz <Stromeko@NexGo.DE>
Sat, 6 Dec 2014 13:52:49 +0000 (13:52 +0000)
     * 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".

ChangeLog
script.cc

index 8a0ddeae833f9152f7955cc1e8f48380dd730a6a..275e3dcac19a6c765fdb161402ac94c2a79d6b9f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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
index 9530b1e03c9719ef477421a5fe744280414eeb54..016d7abe1460b2cfd72500894dbdc69f1c3e7bed 100644 (file)
--- a/script.cc
+++ b/script.cc
@@ -42,7 +42,7 @@ static const char *cvsid =
 #endif
 #endif
 
-static std::string sh;
+static std::string sh, dash;
 static const char *cmd;
 
 static void
@@ -113,8 +113,9 @@ init_run_script ()
   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
@@ -279,7 +280,13 @@ Script::run() const
       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);
This page took 0.037352 seconds and 5 git commands to generate.