feat: add Linux/Unix scripts and Makefile entry

This commit is contained in:
FlipWind
2026-08-09 00:12:13 +08:00
parent cd19dddad1
commit b57726f434
6 changed files with 409 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# SFCraft 文档构建入口 (Linux / macOS / Unix): 先同步贴图, 再执行 hugo 构建。
# 贴图同步失败(有物品找不到)时终止构建。
# 用法: ./scripts/build.sh [hugo 参数...]
set -euo pipefail
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo
echo "[1/2] 同步物品贴图"
"$DIR/sync-items.sh"
if ! command -v hugo >/dev/null 2>&1; then
echo "[错误] 未找到 hugo, 请安装 Hugo 或将其加入 PATH。" >&2
exit 1
fi
echo
echo "[2/2] hugo 构建"
exec hugo "$@"