feat(cli,registry): introduce --herdr-workspace option and decouple socket fallback chains
This commit is contained in:
@@ -22,6 +22,7 @@ WORKSPACE=""
|
||||
AGENT=""
|
||||
SESSION_NAME=""
|
||||
HERDR_SERVER_OPT=""
|
||||
HERDR_WORKSPACE_OPT=""
|
||||
|
||||
DRY_RUN=0
|
||||
|
||||
@@ -31,6 +32,7 @@ while [ $# -gt 0 ]; do
|
||||
--agent) AGENT="$2"; shift 2 ;;
|
||||
--session) SESSION_NAME="$2"; shift 2 ;;
|
||||
--herdr-session|--herdr-server) HERDR_SERVER_OPT="$2"; shift 2 ;;
|
||||
--herdr-workspace) HERDR_WORKSPACE_OPT="$2"; shift 2 ;;
|
||||
--dry-run) DRY_RUN=1; shift ;;
|
||||
-h|--help) usage; exit 0 ;;
|
||||
*) echo "ERROR: unknown arg: $1" >&2; exit 2 ;;
|
||||
@@ -71,7 +73,8 @@ if herdr has-session -t "$SESSION_NAME" 2>/dev/null; then
|
||||
# Just update YAML to make sure it's set to running
|
||||
bash "$(dirname "${BASH_SOURCE[0]}")/update_yaml_resumed.sh" \
|
||||
--session "$SESSION_NAME" --uuid "$UUID" --agent "$AGENT" --workspace "$WORKSPACE" \
|
||||
--herdr-session "$HERDR_SESSION_NAME"
|
||||
--herdr-session "$HERDR_SESSION_NAME" \
|
||||
${HERDR_WORKSPACE_OPT:+--herdr-workspace "$HERDR_WORKSPACE_OPT"}
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -135,6 +138,7 @@ sleep 2
|
||||
# 5. Update agent-sessions.yaml: status running, last_visible_status
|
||||
bash "$(dirname "${BASH_SOURCE[0]}")/update_yaml_resumed.sh" \
|
||||
--session "$SESSION_NAME" --uuid "$UUID" --agent "$AGENT" --workspace "$WORKSPACE" \
|
||||
--herdr-session "$HERDR_SESSION_NAME"
|
||||
--herdr-session "$HERDR_SESSION_NAME" \
|
||||
${HERDR_WORKSPACE_OPT:+--herdr-workspace "$HERDR_WORKSPACE_OPT"}
|
||||
|
||||
echo "Successfully resumed $SESSION_NAME ($AGENT)"
|
||||
|
||||
Reference in New Issue
Block a user