Pi66

merodi
A markdown-based static site generator.
git clone https://git.pi66.xyz/merodi

← back to log

feat:add build validation and force options

author: pixel
date: 2026-07-22 09:31
hash: b7044abaac0ef5e3ee696710fdbd4bfee6f136fc

Diffstat:

M

src/main.py
4 ++++++++++++++++++++++--------
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
diff --git a/src/main.py b/src/main.py
index 36f110c..7249b78 100755
--- a/src/main.py
+++ b/src/main.py
@@ -30,6 +30,8 @@ def main():
     build_mode = build_parser.add_mutually_exclusive_group()
     build_mode.add_argument("--draft", action="store_true", default=True)
     build_mode.add_argument("--release", action="store_true")
+    build_parser.add_argument("--validate", action="store_true")
+    build_parser.add_argument("--force", action="store_true")
     build_parser.add_argument("path", nargs="?")
     build_parser.add_argument("--file", nargs=2, metavar=("SRC", "DEST"))

@@ -58,7 +60,7 @@ def main():
         mode = "release" if args.release else "draft"
         api.mode = mode
         from .build import build
-        build(mode = mode, project_path = args.path, file=args.file)
+        build(mode = mode, project_path = args.path, file=args.file, validate = args.validate, force = args.force)

     elif args.command == "webview":
         from .webviewer import run