diff options
-rwxr-xr-x | tools/skqp/download_model | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/skqp/download_model b/tools/skqp/download_model index c18ebfa428..209f550590 100755 --- a/tools/skqp/download_model +++ b/tools/skqp/download_model @@ -43,11 +43,14 @@ def tmp(prefix): return path def main(): - os.chdir(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, - 'platform_tools', 'android', 'apps', 'skqp', 'src', - 'main', 'assets')) + target_dir = os.path.join('platform_tools', 'android', 'apps', 'skqp', 'src', 'main', 'assets') + os.chdir(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, target_dir)) + checksum_path = 'files.checksum' + if not os.path.isfile(checksum_path): + sys.stderr.write('Error: "%s" is missing.\n' % os.path.join(target_dir, checksum_path)) + sys.exit(1) file_list_file = tmp('files_') - with open('files.checksum', 'r') as f: + with open(checksum_path, 'r') as f: md5 = f.read().strip() assert(len(md5) == 32) download(md5, file_list_file) |