From 59491add5e673e29611d435b62e8de104eb0494f Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Tue, 19 Dec 2017 12:33:12 +0100 Subject: [PATCH] More robust argument parsing in sync-dist.py --- ci/sync-dist.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ci/sync-dist.py b/ci/sync-dist.py index 870e13c7a5..e989f967b7 100644 --- a/ci/sync-dist.py +++ b/ci/sync-dist.py @@ -60,13 +60,16 @@ def usage(): "update-prod-release"]: usage() +if "--live-run" in sys.argv: + live_run = True + sys.argv.remove("--live-run") + if "archives" in command or "release" in command: - if len(sys.argv) < 3: + if len(sys.argv) != 3: usage() archive_version = sys.argv[2] - -if "--live-run" in sys.argv: - live_run = True +elif len(sys.argv) != 2: + usage() dev_s3_bucket = "dev-static-rust-lang-org" prod_s3_bucket = "static-rust-lang-org"