From a8f34982a09370ee476b30f587501c8ccc91f069 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 30 Jan 2014 22:01:22 +0800 Subject: [PATCH] Enable passing --commit to download script. --- brightray/script/bootstrap | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/brightray/script/bootstrap b/brightray/script/bootstrap index 0325f49b0c3b..05011fce3cdc 100755 --- a/brightray/script/bootstrap +++ b/brightray/script/bootstrap @@ -15,11 +15,13 @@ DOWNLOAD_DIR = os.path.join(VENDOR_DIR, 'download') def main(): args = parse_args() return (update_submodules() or - download_libchromiumcontent(args.url)) + download_libchromiumcontent(args.commit, args.url)) def parse_args(): parser = argparse.ArgumentParser(description='Bootstrap this project') + parser.add_argument('-c', '--commit', nargs='?', default='HEAD', + help='The commit of libchromiumcontent to download.') parser.add_argument('url', help='The base URL from which to download ' 'libchromiumcontent (i.e., the URL you passed to ' 'libchromiumcontent\'s script/upload script') @@ -32,11 +34,11 @@ def update_submodules(): '--recursive'])) -def download_libchromiumcontent(url): +def download_libchromiumcontent(commit, url): mkdir_p(DOWNLOAD_DIR) download = os.path.join(VENDOR_DIR, 'libchromiumcontent', 'script', 'download') - return subprocess.call([sys.executable, download, '-f', url, + return subprocess.call([sys.executable, download, '-f', '-c', commit, url, os.path.join(DOWNLOAD_DIR, 'libchromiumcontent')])