From 784d417881bcb1889d5d17908d47ffd9d9f8cc0b Mon Sep 17 00:00:00 2001 From: Dragon Dave McKee Date: Thu, 1 Aug 2024 18:10:09 +0100 Subject: [PATCH] Use --for-real parameter to set whether it's a dry run --- utilities/spreadsheet_docx/copy_from_bailii_s3.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/utilities/spreadsheet_docx/copy_from_bailii_s3.py b/utilities/spreadsheet_docx/copy_from_bailii_s3.py index 7240ab7..bb59204 100644 --- a/utilities/spreadsheet_docx/copy_from_bailii_s3.py +++ b/utilities/spreadsheet_docx/copy_from_bailii_s3.py @@ -18,13 +18,14 @@ SOURCE_BUCKET = "bailii-docx" UNPUBLISHED_BUCKET = "tna-caselaw-unpublished-assets" PUBLISHED_BUCKET = "tna-caselaw-assets" -DRY_RUN = "--dryrun" -# DRY_RUN = False DALMATIAN_INFRASTRUCTURE = "caselaw" ASSETS_BASE = "https://tna-caselaw-assets.s3.amazonaws.com" CASELAW_BASE = "https://caselaw.nationalarchives.gov.uk" SPREADSHEET = "bailii_files.csv" +DRY_RUN = "--for-real" not in sys.argv[1:] +if not DRY_RUN: + print("Running for real...") # NOTE THIS MUST BE RUN AS A V2 DALMATIAN # Run `dalmatian version -v 2` first @@ -76,7 +77,7 @@ def copy_command(self, target_bucket): else: raise RuntimeError - dryrun_bonus = [DRY_RUN] if DRY_RUN else [] + dryrun_bonus = ["--dryrun"] if DRY_RUN else [] command = [ "dalmatian",