Keep the OpenClaw that can open the state when removal keeps the state

Removing the runtime while keeping ~/.openclaw left state that its own updates had migrated past the packaged release, and reinstalling seeded a release that refused to open it; even `openclaw update` refused. Removal now takes openclaw off PATH and leaves the runtime inside ~/.openclaw with the state, where a reinstall picks it back up; deleting ~/.openclaw still takes both.
This commit is contained in:
Spencer Bull committed 2026-09-26 01:16:26 -05:00
1 parent 44f5fd8f0e
commit d2305add6a
3 files changed
+15 -23

No files matched your search

+9 -12
View File
@@ -299,26 +299,23 @@ pass "OpenClaw removal stops the gateway service"
fail "OpenClaw removal keeps the user's agent state" "asked about ~/.openclaw without a terminal"
pass "OpenClaw removal keeps the user's agent state"
# The runtime omarchy-install-openclaw-cli set up sits beside that state and
# goes; a command that is not the installer's, or a link elsewhere, stays.
# The command on PATH goes; the OpenClaw it pointed at stays with the state,
# since only that copy is sure to open it. A link somewhere else is not Omarchy's.
fresh_openclaw_home
mkdir -p "$HOME/.openclaw/bin" "$HOME/.openclaw/tools/node-v24.19.0/lib" "$HOME/.local/bin"
printf '#!/usr/bin/env bash\nexec "%s/.openclaw/tools/node/bin/node" "%s/.openclaw/tools/node-v24.19.0/lib/node_modules/openclaw/dist/entry.js" "$@"\n' "$HOME" "$HOME" >"$HOME/.openclaw/bin/openclaw"
printf '#!/usr/bin/env bash\n' >"$HOME/.openclaw/bin/openclaw"
ln -s "$HOME/.openclaw/bin/openclaw" "$HOME/.local/bin/openclaw"
"$ROOT/bin/omarchy-remove-ai-openclaw" >/dev/null
for gone in .openclaw/tools .openclaw/bin .local/bin/openclaw; do
[[ ! -e $HOME/$gone && ! -L $HOME/$gone ]] || fail "OpenClaw removal deletes the runtime it set up" "$gone"
done
[[ -f $HOME/.openclaw/openclaw.json ]] || fail "OpenClaw removal deletes the runtime it set up" "state went with it"
[[ ! -e $HOME/.local/bin/openclaw && ! -L $HOME/.local/bin/openclaw ]] || fail "OpenClaw removal takes openclaw off PATH"
[[ -f $HOME/.openclaw/bin/openclaw && -d $HOME/.openclaw/tools && -f $HOME/.openclaw/openclaw.json ]] ||
fail "OpenClaw removal keeps the OpenClaw that can open the state"
fresh_openclaw_home
mkdir -p "$HOME/.openclaw/bin" "$HOME/.openclaw/tools" "$HOME/.local/bin"
printf '#!/bin/bash\nexec /opt/openclaw/openclaw.mjs "$@"\n' >"$HOME/.openclaw/bin/openclaw"
mkdir -p "$HOME/.local/bin"
ln -s /opt/openclaw/openclaw "$HOME/.local/bin/openclaw"
"$ROOT/bin/omarchy-remove-ai-openclaw" >/dev/null
[[ -f $HOME/.openclaw/bin/openclaw && -d $HOME/.openclaw/tools && -L $HOME/.local/bin/openclaw ]] ||
fail "OpenClaw removal deletes the runtime it set up" "someone else's install went with it"
pass "OpenClaw removal deletes the runtime it set up, and only that"
[[ -L $HOME/.local/bin/openclaw ]] || fail "OpenClaw removal takes openclaw off PATH" "someone else's link went with it"
pass "OpenClaw removal takes openclaw off PATH and keeps the copy that can open the state"
# A CLI that knows `gateway uninstall` owns the teardown; the manual systemd
# fallback must not run.