🐛 fix(scripts): require existing project root

This commit is contained in:
csh 2026-01-08 15:39:09 +08:00
parent 15d4d63f24
commit 31dd0c5a38
1 changed files with 4 additions and 1 deletions

View File

@ -54,7 +54,10 @@ fi
timestamp="$(date +%Y%m%d%H%M%S 2>/dev/null || echo bak)" timestamp="$(date +%Y%m%d%H%M%S 2>/dev/null || echo bak)"
mkdir -p "$PROJECT_ROOT" if [ ! -d "$PROJECT_ROOT" ]; then
echo "ERROR: project root does not exist: $PROJECT_ROOT" >&2
exit 1
fi
PROJECT_ROOT_ABS="$(CDPATH= cd -- "$PROJECT_ROOT" && pwd -P)" PROJECT_ROOT_ABS="$(CDPATH= cd -- "$PROJECT_ROOT" && pwd -P)"
DEST_PREFIX="$PROJECT_ROOT_ABS/docs/standards/playbook" DEST_PREFIX="$PROJECT_ROOT_ABS/docs/standards/playbook"
DEST_STANDARDS="$PROJECT_ROOT_ABS/docs/standards" DEST_STANDARDS="$PROJECT_ROOT_ABS/docs/standards"