chore(scripts): move install and uninstall scripts to scripts dir
This commit is contained in:
@@ -2,5 +2,4 @@ iris
|
|||||||
iris.log
|
iris.log
|
||||||
autocomplete
|
autocomplete
|
||||||
temp
|
temp
|
||||||
uninstall.sh
|
|
||||||
docs/guide.md
|
docs/guide.md
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Iris installer
|
# Iris installer
|
||||||
# Usage: curl -sS https://raw.githubusercontent.com/versenilvis/iris/main/install.sh | sudo sh
|
# Usage: curl -sS https://raw.githubusercontent.com/versenilvis/iris/main/scripts/install.sh | sudo sh
|
||||||
|
|
||||||
REPO="versenilvis/iris"
|
REPO="versenilvis/iris"
|
||||||
BIN_DIR="${BIN_DIR:-/usr/local/bin}"
|
BIN_DIR="${BIN_DIR:-/usr/local/bin}"
|
||||||
Executable
+43
@@ -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"
|
||||||
Reference in New Issue
Block a user