Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0-JSR-3
-
Fix Version/s: 1.7.2, 1.6.9, 1.8-beta-1
-
Component/s: None
-
Labels:None
-
Environment:win xp sp2, java 1.4.2_09
-
Testcase included:yes
-
Number of attachments :
Description
Running groovy from within another script does not give the real exit value of the groovy process. Try any of the following:
perl -e "system('groovy -e \"System.exit(1)\"');print $?>>8"
ruby -e "system('groovy.bat -e \"System.exit(1)\"');print $?>>8"
groovy -e "p='groovy.bat -e \"System.exit(1)\"'.execute();p.waitFor();println p.exitValue()"
To see that the above examples are correct in catching the exit code, try e.g.
ruby -e "system('ruby -e \"exit(2)\"');print $?>>8"
groovy -e "def p='ruby -e \"exit(2)\"'.execute();;p.waitFor();println p.exitValue()"
Adding
exit %ERROR_LEVEL%
to the end of groovy.bat solves the problem but is not usable as it causes command prompt to exit if running groovy directly (i.e. not via some other script).
Activity
blackdrag blackdrag
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | 1.7-beta-1 [ 14014 ] | |
| Assignee | Jochen Theodorou [ blackdrag ] | |
| Fix Version/s | 1.6.1 [ 14852 ] |
Guillaume Laforge
made changes -
| Fix Version/s | 1.6.2 [ 15151 ] | |
| Fix Version/s | 1.6.1 [ 14852 ] |
Guillaume Laforge
made changes -
| Fix Version/s | 1.6.3 [ 15251 ] | |
| Fix Version/s | 1.6.2 [ 15151 ] |
Guillaume Laforge
made changes -
| Fix Version/s | 1.6.3 [ 15251 ] |
Guillaume Laforge
made changes -
| Fix Version/s | 1.7-beta-x [ 15538 ] | |
| Fix Version/s | 1.7-beta-1 [ 14014 ] |
Paul King
made changes -
| Fix Version/s | 1.7.2 [ 16237 ] | |
| Fix Version/s | 1.8-beta-1 [ 16013 ] | |
| Resolution | Fixed [ 1 ] | |
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Fix Version/s | 1.7.X [ 15538 ] | |
| Fix Version/s | 1.6.9 [ 16236 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
can you please test "exit /b %ERROR_LEVEL%" ?