From: Angelo Rodrigues Date: Thu, 14 Aug 2025 01:14:44 +0000 (-0400) Subject: don't require `true` prop when using `--force` X-Git-Url: https://git.xangelo.ca/?a=commitdiff_plain;h=f806d3c45dac518082f09f6e36116e2e342a7955;p=xangelo.ca.git don't require `true` prop when using `--force` --- 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}")