diff options
author | halcanary <halcanary@google.com> | 2016-02-17 13:07:37 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-17 13:07:37 -0800 |
commit | 68af68a0efa50c72ff69003bb8e37268cba985fc (patch) | |
tree | d3dc4ce477c4db895df233bfc220352c212966ee /bin | |
parent | 5f0de06c43c7500413ee3d220db82a97a2b0f459 (diff) |
bin/sync-and-gyp: better error checking
NOTRY=true
Review URL: https://codereview.chromium.org/1704143002
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/sync-and-gyp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bin/sync-and-gyp b/bin/sync-and-gyp index ac6b8392b2..19fc1ed1c6 100755 --- a/bin/sync-and-gyp +++ b/bin/sync-and-gyp @@ -76,6 +76,12 @@ cache_dir = None ''' if current_deps_hash != deps_hash: # `gclient sync` is very slow, so skip whenever we can. + try: + subprocess.call(['gclient', '--version']) + except: + sys.stdout.write('gclient missing from $PATH, please install ' + + 'depot_tools\n https://skia.org/user/quick/desktop\n') + exit(1) if not os.path.isfile('.gclient'): with open('.gclient', 'w') as o: o.write(default_gclient_config) @@ -85,7 +91,10 @@ if current_deps_hash != deps_hash: subprocess.check_call(gclient_sync_command) except: sys.stderr.write('\n`gclient sync` failed.\n') - os.remove('.deps_sha1') # Unknown state. + try: + os.remove('.deps_sha1') # Unknown state. + except: + pass exit(1) # Only write hash after a successful sync. with open('.deps_sha1', 'w') as o: |