From f806d3c45dac518082f09f6e36116e2e342a7955 Mon Sep 17 00:00:00 2001 From: Angelo Rodrigues Date: Wed, 13 Aug 2025 21:14:44 -0400 Subject: [PATCH] don't require `true` prop when using `--force` --- .github/scripts/medium_to_hugo.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/scripts/medium_to_hugo.py b/.github/scripts/medium_to_hugo.py index ee64e23..f8e5544 100644 --- a/.github/scripts/medium_to_hugo.py +++ b/.github/scripts/medium_to_hugo.py @@ -14,11 +14,7 @@ OUTPUT_DIR = "content/posts/medium" EXISTING_SLUGS = {f[:-3] for f in os.listdir(OUTPUT_DIR) if f.endswith(".md")} # default to false, but read from --force flag if it's set -FORCE_REBUILD = False - -if len(sys.argv) > 1 and sys.argv[1] == "--force": - FORCE_REBUILD = sys.argv[2] == "true" - +FORCE_REBUILD = len(sys.argv) > 1 and sys.argv[1] == "--force": def slugify(title): return re.sub(r"[^\w-]", "", re.sub(r"\s+", "-", title.lower())).strip("-") @@ -98,4 +94,4 @@ for entry in feed.entries: with open(output_path, "w", encoding="utf-8") as f: f.write(frontmatter.dumps(post)) - print(f"Saved: {output_path}") \ No newline at end of file + print(f"Saved: {output_path}") -- 2.25.1