Files
mnote/harness-init.sh
T

23 lines
541 B
Bash
Raw Normal View History

2026-04-14 13:22:29 +08:00
#!/usr/bin/env bash
set -euo pipefail
# Harness 会在每次会话启动时执行此脚本,这里只做轻量且可重复执行的环境检查。
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT_DIR"
command -v git >/dev/null || {
echo "ERROR: 缺少 git"
exit 1
}
command -v python3 >/dev/null || {
echo "ERROR: 缺少 python3"
exit 1
}
if [ -f "$ROOT_DIR/package.json" ] && ! command -v node >/dev/null; then
echo "WARN: 缺少 node,脚本任务可能无法执行"
2026-04-14 13:22:29 +08:00
fi
echo "Harness 环境检查完成"