* Use (( )) for the numeric argument test Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Drop the quotes on a variable inside [[ ]] Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Use omarchy-pkg-drop instead of raw pacman -Rns omarchy-pkg-drop already filters to installed packages, so the 2>/dev/null || true suppression is no longer needed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Drop defensive checks around default-set commands ttfx, imagemagick, and networkmanager are all in the default package set, so their commands are runtime invariants and should be invoked directly. Removing the nmcli guard also removes the degraded wifi fallthrough that only ran when nmcli was missing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
114 lines
2.4 KiB
Bash
Executable File
114 lines
2.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Remove a development environment that was previously installed via omarchy-install-dev-env.
|
|
# omarchy:args=<ruby|node|bun|deno|go|php|laravel|symfony|python|elixir|phoenix|zig|rust|java|dotnet|ocaml|clojure|scala>
|
|
# omarchy:requires-sudo=true
|
|
|
|
if [[ -z $1 ]]; then
|
|
echo "Usage: omarchy-remove-dev-env <ruby|node|bun|deno|go|php|laravel|symfony|python|elixir|phoenix|zig|rust|java|dotnet|ocaml|clojure|scala>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
remove_php() {
|
|
omarchy-pkg-drop php composer php-sqlite xdebug
|
|
}
|
|
|
|
case "$1" in
|
|
ruby)
|
|
echo -e "Removing Ruby...\n"
|
|
mise uninstall ruby --all
|
|
mise rm -g ruby
|
|
rm -f ~/.gemrc
|
|
;;
|
|
node)
|
|
echo -e "Removing Node.js...\n"
|
|
mise uninstall node --all
|
|
mise rm -g node
|
|
;;
|
|
bun)
|
|
echo -e "Removing Bun...\n"
|
|
mise uninstall bun --all
|
|
mise rm -g bun
|
|
;;
|
|
deno)
|
|
echo -e "Removing Deno...\n"
|
|
mise uninstall deno --all
|
|
mise rm -g deno
|
|
;;
|
|
go)
|
|
echo -e "Removing Go...\n"
|
|
mise uninstall go --all
|
|
mise rm -g go
|
|
;;
|
|
php)
|
|
echo -e "Removing PHP...\n"
|
|
remove_php
|
|
;;
|
|
laravel)
|
|
echo -e "Removing Laravel...\n"
|
|
composer global remove laravel/installer 2>/dev/null || true
|
|
;;
|
|
symfony)
|
|
echo -e "Removing Symfony CLI...\n"
|
|
omarchy-pkg-drop symfony-cli
|
|
;;
|
|
python)
|
|
echo -e "Removing Python...\n"
|
|
mise uninstall python --all
|
|
mise rm -g python
|
|
rm -rf ~/.local/bin/uv ~/.local/bin/uvx ~/.cargo/bin/uv 2>/dev/null || true
|
|
;;
|
|
elixir|phoenix)
|
|
echo -e "Removing Elixir/Erlang...\n"
|
|
mise uninstall elixir --all
|
|
mise uninstall erlang --all
|
|
mise rm -g elixir
|
|
mise rm -g erlang
|
|
;;
|
|
zig)
|
|
echo -e "Removing Zig...\n"
|
|
mise uninstall zig --all
|
|
mise uninstall zls --all
|
|
mise rm -g zig
|
|
mise rm -g zls
|
|
;;
|
|
rust)
|
|
echo -e "Removing Rust...\n"
|
|
rustup self uninstall -y 2>/dev/null || true
|
|
;;
|
|
java)
|
|
echo -e "Removing Java...\n"
|
|
mise uninstall java --all
|
|
mise rm -g java
|
|
;;
|
|
dotnet)
|
|
echo -e "Removing .NET...\n"
|
|
mise uninstall dotnet --all
|
|
mise rm -g dotnet
|
|
;;
|
|
ocaml)
|
|
echo -e "Removing OCaml...\n"
|
|
opam switch remove default -y 2>/dev/null || true
|
|
rm -rf ~/.opam 2>/dev/null || true
|
|
sudo rm -f /usr/local/bin/opam 2>/dev/null || true
|
|
;;
|
|
clojure)
|
|
echo -e "Removing Clojure...\n"
|
|
mise uninstall clojure --all
|
|
mise rm -g clojure
|
|
;;
|
|
scala)
|
|
echo -e "Removing Scala...\n"
|
|
mise uninstall scala --all
|
|
mise uninstall scala-cli --all
|
|
mise rm -g scala
|
|
mise rm -g scala-cli
|
|
;;
|
|
*)
|
|
echo "Unknown environment: $1"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
echo -e "\nDone!"
|