Port the selected AI removal scaffold for 4.0.3
Port only Remove > AI and T3 removal/tests from #7504 (023021ad2d). Keep Dictation in its baseline location and omit unrelated removers.
(cherry picked from commit 73480ffabc091b812a0cfbe7bc845799c6078a88)
This commit is contained in:
1 parent
ebaad12947
commit
82de446713
3 files changed
+60
No files matched your search
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
# omarchy:summary=Remove T3 Code along with its configuration and workspaces.
|
||||
# omarchy:requires-sudo=true
|
||||
|
||||
set -e
|
||||
|
||||
omarchy-pkg-drop t3code-bin
|
||||
|
||||
# T3 Code drives agents that keep their own state -- ~/.claude.json, ~/.grok,
|
||||
# ~/.local/share/opencode -- and those outlive it, so only its own goes.
|
||||
rm -rf \
|
||||
"$HOME/.config/t3code" \
|
||||
"$HOME/.t3"
|
||||
rm -f "$HOME/.config/t3code-flags.conf"
|
||||
|
||||
echo ""
|
||||
echo "T3 Code has been removed."
|
||||
@@ -23,6 +23,8 @@
|
||||
"setup": {"icon":"","label":"Setup","aliases":["settings"]},
|
||||
"install": {"icon":"","label":"Install"},
|
||||
"remove": {"icon":"","label":"Remove","aliases":["uninstall"]},
|
||||
"remove.ai": {"icon":"","label":"AI","title":"Remove"},
|
||||
"remove.ai.t3-code": {"icon":"","iconFont":"omarchy","label":"T3 Code","when":"omarchy-pkg-present t3code-bin","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-ai-t3-code"},
|
||||
"update": {"icon":"","label":"Update","aliases":["restart","refresh"]},
|
||||
"about": {"icon":"","label":"About","action":"omarchy-launch-about"},
|
||||
"system": {"icon":"","label":"System","aliases":["power-menu"]},
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
|
||||
|
||||
tmp_dir="$(mktemp -d)"
|
||||
trap 'rm -rf "$tmp_dir"' EXIT
|
||||
|
||||
mkdir -p "$tmp_dir/bin"
|
||||
|
||||
cat >"$tmp_dir/bin/omarchy-pkg-drop" <<'SCRIPT'
|
||||
#!/bin/bash
|
||||
printf 'drop:%s\n' "$*" >>"$TEST_LOG"
|
||||
SCRIPT
|
||||
chmod +x "$tmp_dir/bin/omarchy-pkg-drop"
|
||||
|
||||
export TEST_LOG="$tmp_dir/log"
|
||||
export PATH="$tmp_dir/bin:$PATH"
|
||||
|
||||
fresh_home() {
|
||||
rm -rf "$tmp_dir/home"
|
||||
mkdir -p "$tmp_dir/home"
|
||||
export HOME="$tmp_dir/home"
|
||||
}
|
||||
|
||||
# T3 Code bootstraps the agents it drives; their state outlives it.
|
||||
fresh_home
|
||||
mkdir -p "$HOME/.config/t3code" "$HOME/.t3" "$HOME/.grok" "$HOME/.local/share/opencode" "$HOME/.npm"
|
||||
touch "$HOME/.claude.json"
|
||||
"$ROOT/bin/omarchy-remove-ai-t3-code" >/dev/null
|
||||
|
||||
[[ ! -e $HOME/.t3 ]] || fail "T3 Code removal deletes its own data"
|
||||
pass "T3 Code removal deletes its own data"
|
||||
|
||||
for kept in .grok .claude.json .npm .local/share/opencode; do
|
||||
[[ -e $HOME/$kept ]] || fail "T3 Code removal keeps the agent state it bootstrapped" "$kept"
|
||||
done
|
||||
pass "T3 Code removal keeps the agent state it bootstrapped"
|
||||
|
||||
Reference in new issue
Block a user