Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: bin/sync-and-gyp

Issue 1704143002: bin/sync-and-gyp: better error checking (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/sync-and-gyp
diff --git a/bin/sync-and-gyp b/bin/sync-and-gyp
index ac6b8392b23b1cf1285772ee773683cf9754d523..19fc1ed1c62a392615488e48dc95e45595698578 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:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698