41 lines
830 B
Bash
Executable File
41 lines
830 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
|
|
run_step() {
|
|
local title="$1"
|
|
shift
|
|
|
|
echo
|
|
echo ">>> ${title}"
|
|
"$@"
|
|
}
|
|
|
|
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
|
|
fi
|
|
}
|
|
|
|
run_npm_script() {
|
|
local dir="$1"
|
|
local script="$2"
|
|
|
|
ensure_node_modules "$dir"
|
|
run_step "${dir}: npm run ${script}" bash -lc "cd '$ROOT_DIR/$dir' && npm run ${script}"
|
|
}
|
|
|
|
run_npm_script "Yonexus.Protocol" test
|
|
run_npm_script "Yonexus.Server" check
|
|
run_npm_script "Yonexus.Server" test
|
|
run_npm_script "Yonexus.Client" check
|
|
run_npm_script "Yonexus.Client" test
|
|
|
|
echo
|
|
printf 'Yonexus v1 validation passed.\n'
|