chore: tighten yonexus v1 validation flow

This commit is contained in:
nav
2026-04-09 05:03:06 +00:00
parent 3bb0a79057
commit 17b9cc83f4
4 changed files with 26 additions and 16 deletions

View File

@@ -15,11 +15,17 @@ run_step() {
ensure_node_modules() {
local dir="$1"
if [[ ! -d "$ROOT_DIR/$dir/node_modules" ]]; then
echo "Missing dependencies in $dir (node_modules not found)."
echo "Run: (cd '$ROOT_DIR/$dir' && npm install)"
return 1
if [[ -d "$ROOT_DIR/$dir/node_modules" ]]; then
return 0
fi
local install_cmd="npm install"
if [[ -f "$ROOT_DIR/$dir/package-lock.json" ]]; then
install_cmd="npm ci"
fi
echo "Dependencies missing in $dir (node_modules not found). Bootstrapping with: ${install_cmd}"
run_step "${dir}: ${install_cmd}" bash -lc "cd '$ROOT_DIR/$dir' && ${install_cmd}"
}
run_npm_script() {
@@ -30,6 +36,7 @@ run_npm_script() {
run_step "${dir}: npm run ${script}" bash -lc "cd '$ROOT_DIR/$dir' && npm run ${script}"
}
run_npm_script "Yonexus.Protocol" check
run_npm_script "Yonexus.Protocol" test
run_npm_script "Yonexus.Server" check
run_npm_script "Yonexus.Server" test