diff options
author | Christopher Vogt <github.com.nsp@cvogt.org> | 2012-01-20 23:27:42 +0100 |
---|---|---|
committer | Christopher Vogt <github.com.nsp@cvogt.org> | 2012-01-20 23:27:42 +0100 |
commit | c1b20310728646f7c92bfa54726951b569cfebd3 (patch) | |
tree | 75c85f312122c276096ecbd374a65554f07f27a4 /src/compiler/scala/tools/ant | |
parent | beeac27cb480399eb787b47ef83906dd91935640 (diff) | |
download | scala-c1b20310728646f7c92bfa54726951b569cfebd3.tar.gz scala-c1b20310728646f7c92bfa54726951b569cfebd3.tar.bz2 scala-c1b20310728646f7c92bfa54726951b569cfebd3.zip |
Fixed windows bat file exit code and command chaining (finally)
The problem was, that executing the following command in the windows
shell, always executed scala.bat regardless of the outcome of scalac.bat:
scalac.bat somefile.scala && scala.bat Test
Apparently exit codes are broken for windows bat files.
Implementing the workaround suggested at
http://stackoverflow.com/questions/4632891/exiting-batch-with-exit-b-x-where-x-1-acts-as-if-command-completed-successfu
fixed the problem. Tested manually in Windows 7 64.
Diffstat (limited to 'src/compiler/scala/tools/ant')
-rw-r--r-- | src/compiler/scala/tools/ant/templates/tool-windows.tmpl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/ant/templates/tool-windows.tmpl b/src/compiler/scala/tools/ant/templates/tool-windows.tmpl index 9f1fbc4524..5949689b24 100644 --- a/src/compiler/scala/tools/ant/templates/tool-windows.tmpl +++ b/src/compiler/scala/tools/ant/templates/tool-windows.tmpl @@ -86,4 +86,6 @@ goto :eof :end
@@endlocal
-exit /b %errorlevel%
+
+REM exit code fix, see http://stackoverflow.com/questions/4632891/exiting-batch-with-exit-b-x-where-x-1-acts-as-if-command-completed-successfu
+@@%COMSPEC% /C exit %errorlevel% >nul
|