klipstein/dojango — Issue #84: 86 - Dojobuild should return nonzero status code on error. 
Author: klipstein
Created: 2011-11-06 13:37:07+00:00
State: open

What steps will reproduce the problem?
1. make syntax error in javascipr
2. run dojobuild (shrinksafe program ends with nonzero status)
3. echo $? # shell

What is the expected output? What do you see instead?
Expected: nonzero, because error happended.
Obtained: 0

What version of the product are you using? On what operating system?
Dojango trunk, current Ubuntu, python 2.7

Please provide any additional information below.

Cause lays in dojango.management.commands.dojobuild.Command.handle:
===
# do the build
os.system(exe_command)
===
Value returned by os.system() is ignored.

IMPORTANT:
Java command can return exit status beyound 255, and kind of int overflow can happen, so you should do something like this:
===
exit_code = os.system(exe_command)
if exit_code: # != 0
sys.exit(1) # dojobuild exits because shhrinksafe error

===

IMPORTANT2:
Other errors during dojobuild should also end with nonzero exit status.

Original link: http://code.google.com/p/dojango/issues/detail?id=86