Files
OmniSocketGo/scripts/dev/start-dev-tmux.sh
2026-04-09 18:13:03 +08:00

22 lines
761 B
Bash

#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SESSION_NAME="${1:-robot-remote}"
if ! command -v tmux >/dev/null 2>&1; then
echo "tmux is required for this launcher" >&2
exit 1
fi
if tmux has-session -t "${SESSION_NAME}" 2>/dev/null; then
exec tmux attach -t "${SESSION_NAME}"
fi
tmux new-session -d -s "${SESSION_NAME}" -n backend "bash -lc '${SCRIPT_DIR}/start-backend.sh'"
tmux new-window -t "${SESSION_NAME}:" -n frontend "bash -lc '${SCRIPT_DIR}/start-frontend.sh'"
tmux new-window -t "${SESSION_NAME}:" -n ros "bash -lc '${SCRIPT_DIR}/start-ros-receiver.sh'"
tmux new-window -t "${SESSION_NAME}:" -n b-side "bash -lc '${SCRIPT_DIR}/start-b-side-omnid.sh'"
exec tmux attach -t "${SESSION_NAME}"