Ensure WORKSPACE_PATH from remote .env exists on VM
This commit is contained in:
@@ -69,6 +69,23 @@ REMOTE_COMPOSE_CONTENT=$(ssh_cmd "cat $REMOTE_COMPOSE 2>/dev/null") || {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ── Ensure workspace directory exists on remote ─────────────────────
|
||||||
|
REMOTE_ENV="~/opencode-devbox/.env"
|
||||||
|
WORKSPACE_PATH=$(ssh_cmd "grep -E '^\s*WORKSPACE_PATH=' $REMOTE_ENV 2>/dev/null | cut -d= -f2- | tr -d '\"'" 2>/dev/null || true)
|
||||||
|
if [[ -n "$WORKSPACE_PATH" ]]; then
|
||||||
|
info "Ensuring WORKSPACE_PATH (${WORKSPACE_PATH}) exists on ${SSH_HOST}..."
|
||||||
|
ssh_cmd "mkdir -p ${WORKSPACE_PATH}"
|
||||||
|
ok "Workspace directory ready"
|
||||||
|
else
|
||||||
|
# Default from docker-compose.yml is ~/projects or current dir
|
||||||
|
WORKSPACE_PATH=$(echo "$REMOTE_COMPOSE_CONTENT" | grep -oP 'WORKSPACE_PATH:-[^}]+' | sed 's/WORKSPACE_PATH:-//' || true)
|
||||||
|
if [[ -n "$WORKSPACE_PATH" && "$WORKSPACE_PATH" != "." ]]; then
|
||||||
|
info "Ensuring default WORKSPACE_PATH (${WORKSPACE_PATH}) exists on ${SSH_HOST}..."
|
||||||
|
ssh_cmd "mkdir -p ${WORKSPACE_PATH}"
|
||||||
|
ok "Workspace directory ready"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# ── Detect active bind mounts ──────────────────────────────────────
|
# ── Detect active bind mounts ──────────────────────────────────────
|
||||||
SYNCED=0
|
SYNCED=0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user