From eaa7344a24a0a2b5feaad1daba379a3611152557 Mon Sep 17 00:00:00 2001 From: verse91 Date: Sun, 10 May 2026 00:27:09 +0700 Subject: [PATCH] feat(script): uninstaller --- .gitignore | 1 - uninstall.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100755 uninstall.sh diff --git a/.gitignore b/.gitignore index 5e15196..13f159c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,4 @@ iris iris.log autocomplete temp -uninstall.sh docs/guide.md \ No newline at end of file diff --git a/uninstall.sh b/uninstall.sh new file mode 100755 index 0000000..8731a9b --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +echo "Uninstalling Iris..." + + +BIN_LOCATIONS=( + "$HOME/.local/bin/iris" + "/usr/local/bin/iris" +) + +for loc in "${BIN_LOCATIONS[@]}"; do + if [ -f "$loc" ]; then + echo "Removing binary: $loc" + if [ -w "$(dirname "$loc")" ]; then + rm -f "$loc" + else + sudo rm -f "$loc" + fi + fi +done + + +CONFIG_FILES=( + "$HOME/.zshrc" + "$HOME/.bashrc" + "$HOME/.config/fish/config.fish" +) + +for file in "${CONFIG_FILES[@]}"; do + if [ -f "$file" ]; then + echo "Removing integration from $file..." + sed -i '/# Iris Autocomplete/d' "$file" + sed -i '/iris init/d' "$file" + sed -i '/^$/N;/^\n$/D' "$file" + fi +done + +if [ -f "iris.log" ]; then + rm -f "iris.log" +fi + +echo "✓ Iris has been successfully uninstalled" +echo "Please restart your terminal or source your config file to clear the environment"