mirror of
https://github.com/hansjone/oclaw.git
synced 2026-10-09 12:30:44 +08:00
同时收敛启动与运维脚本默认行为(含 wiki worker)、更新 Admin 可观测性与相关测试,降低首轮时延并提高运行稳定性。 Made-with: Cursor
31 lines
687 B
Bash
31 lines
687 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
|
|
if [[ $# -lt 1 ]]; then
|
|
echo "usage: run-node-tool.sh <tool> [args...]" >&2
|
|
exit 2
|
|
fi
|
|
|
|
tool="$1"
|
|
shift
|
|
|
|
if [[ -f "$ROOT_DIR/pnpm-lock.yaml" ]] && command -v pnpm >/dev/null 2>&1; then
|
|
exec pnpm exec "$tool" "$@"
|
|
fi
|
|
|
|
if { [[ -f "$ROOT_DIR/bun.lockb" ]] || [[ -f "$ROOT_DIR/bun.lock" ]]; } && command -v bun >/dev/null 2>&1; then
|
|
exec bunx --bun "$tool" "$@"
|
|
fi
|
|
|
|
if command -v npm >/dev/null 2>&1; then
|
|
exec npm exec -- "$tool" "$@"
|
|
fi
|
|
|
|
if command -v npx >/dev/null 2>&1; then
|
|
exec npx "$tool" "$@"
|
|
fi
|
|
|
|
echo "Missing package manager: pnpm, bun, or npm required." >&2
|
|
exit 1
|