feat: add Linux/Unix scripts and Makefile entry
This commit is contained in:
@@ -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 "$@"
|
||||
Reference in New Issue
Block a user