From b93564894ce3ca476c0b8550d7405af2b46cdca9 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 8 Aug 2014 23:23:56 +0800 Subject: [PATCH] Make script quit when error happens in child processes. --- script/build.py | 4 +++- script/update.py | 15 +++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/script/build.py b/script/build.py index 42fc24b6d2c8..1dd60deffe17 100755 --- a/script/build.py +++ b/script/build.py @@ -20,7 +20,9 @@ def main(): args = parse_args() for config in args.configuration: build_path = os.path.join('out', config) - subprocess.call([ninja, '-C', build_path, args.target]) + ret = subprocess.call([ninja, '-C', build_path, args.target]) + if ret != 0: + sys.exit(ret) def parse_args(): diff --git a/script/update.py b/script/update.py index 0e958375667d..61eb4088be5d 100755 --- a/script/update.py +++ b/script/update.py @@ -35,12 +35,15 @@ def update_gyp(): if sys.platform == 'cygwin': # Force using win32 python on cygwin. python = os.path.join('vendor', 'python_26', 'python.exe') - subprocess.call([python, gyp, - '-f', 'ninja', '--depth', '.', 'atom.gyp', - '-Icommon.gypi', '-Ivendor/brightray/brightray.gypi', - '-Dlinux_clang=0', # Disable brightray's clang setting - '-Dtarget_arch={0}'.format(arch), - '-Dlibrary=static_library']) + + ret = subprocess.call([python, gyp, + '-f', 'ninja', '--depth', '.', 'atom.gyp', + '-Icommon.gypi', '-Ivendor/brightray/brightray.gypi', + '-Dlinux_clang=0', # Disable brightray's clang setting + '-Dtarget_arch={0}'.format(arch), + '-Dlibrary=static_library']) + if ret != 0: + sys.exit(ret) if __name__ == '__main__':