-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathRestart.sh
More file actions
executable file
·33 lines (27 loc) · 1.08 KB
/
Copy pathRestart.sh
File metadata and controls
executable file
·33 lines (27 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env sh
set -eu
cd "$(dirname "$0")"
WORKSPACE_ROOT="$(pwd)"
PYTHON_BIN="${PYTHON_BIN:-}"
if [ -z "$PYTHON_BIN" ]; then
for candidate in "$WORKSPACE_ROOT/AgentPark_Linux_env/bin/python" "$WORKSPACE_ROOT/.venv/bin/python" python3 python; do
if command -v "$candidate" >/dev/null 2>&1 && "$candidate" -m pip --version >/dev/null 2>&1; then
PYTHON_BIN="$candidate"
break
fi
done
fi
if [ -z "$PYTHON_BIN" ]; then
echo "[ERROR] Could not find a Python interpreter with pip available." >&2
exit 1
fi
echo "[INFO] Restarting AgentPark..."
"$PYTHON_BIN" scripts/restart_agentpark.py --workspace-root "$WORKSPACE_ROOT" --stop-only
if git status --porcelain | grep . >/dev/null 2>&1; then
echo "[WARN] Working tree has local changes; skipping git pull --rebase."
else
echo "[INFO] Updating repository with git pull --rebase..."
git pull --rebase || echo "[WARN] git pull --rebase failed; continuing startup with current workspace."
fi
echo "[INFO] Starting AgentPark through build_and_run.sh..."
AGENTPARK_NO_PAUSE=1 exec "$WORKSPACE_ROOT/build_and_run.sh" "$@"