refactor: unify build scripts to Python 3

This commit is contained in:
FlipWind
2026-08-09 00:53:55 +08:00
parent 7c76365942
commit 9b171ed169
13 changed files with 173 additions and 466 deletions
+8 -13
View File
@@ -1,23 +1,18 @@
# SFCraft 文档 · 构建 / 开发入口 (跨平台)
# SFCraft 文档 · 构建 / 开发入口 (跨平台, 脚本为 Python 3)
#
# Linux / macOS: make build / make dev / make sync
# Windows(有 make 时): 同样可用, 自动调用 PowerShell 脚本
# make build / make dev / make sync / make help
#
# 可附加 hugo 参数: make dev HUGO_ARGS="--port 1314"
# 可指定解释器: make PY=python3 build
.PHONY: help sync build dev
HUGO_ARGS ?=
ifeq ($(OS),Windows_NT)
PS := powershell -NoProfile -ExecutionPolicy Bypass -File
BUILD_CMD := $(PS) scripts/build.ps1
DEV_CMD := $(PS) scripts/dev.ps1
SYNC_CMD := $(PS) scripts/sync-items.ps1
PY ?= python
else
BUILD_CMD := ./scripts/build.sh
DEV_CMD := ./scripts/dev.sh
SYNC_CMD := ./scripts/sync-items.sh
PY ?= python3
endif
help:
@@ -30,10 +25,10 @@ help:
@echo 可附加 hugo 参数: make dev HUGO_ARGS="--port 1314"
sync:
$(SYNC_CMD)
$(PY) scripts/sync-items.py
build:
$(BUILD_CMD) $(HUGO_ARGS)
$(PY) scripts/build.py $(HUGO_ARGS)
dev:
$(DEV_CMD) $(HUGO_ARGS)
$(PY) scripts/dev.py $(HUGO_ARGS)