fetch-clang-format: better error checking
Change-Id: Idc0e984275056128301d4f1ae66aa6ace67b05d5
Reviewed-on: https://skia-review.googlesource.com/98322
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
diff --git a/bin/fetch-clang-format b/bin/fetch-clang-format
index 78b5c05..98216d8 100755
--- a/bin/fetch-clang-format
+++ b/bin/fetch-clang-format
@@ -19,7 +19,11 @@
'buildtools/mac/' + target if 'darwin' in sys.platform else \
'buildtools/win/'+ target + '.exe'
- sha1 = open(target_path + '.sha1').read().strip()
+ sha1_path = target_path + '.sha1'
+ if not os.path.exists(sha1_path):
+ print sha1_path, 'is missing. Did you run `tools/git-sync-deps`?'
+ exit(1)
+ sha1 = open(sha1_path).read().strip()
def sha1_of_file(path):
h = hashlib.sha1()