don't require `true` prop when using `--force`
authorAngelo Rodrigues <git@xangelo.ca>
Thu, 14 Aug 2025 01:14:44 +0000 (21:14 -0400)
committerGitHub <noreply@github.com>
Thu, 14 Aug 2025 01:14:44 +0000 (21:14 -0400)
.github/scripts/medium_to_hugo.py

index ee64e239f5983f6ae3c06443e3fd6ea842461e0a..f8e5544357fb8278f2edf6ee3f04327a5c41b4c3 100644 (file)
@@ -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}")