Create pkg-remove

This commit is contained in:
vx_clutch
2025-09-09 12:13:59 -04:00
committed by GitHub
parent c597ebd4fe
commit 10628d4858

25
bin/.local/bin/pkg-remove Normal file
View File

@@ -0,0 +1,25 @@
#!/bin/sh
pkgs="$@"
installer="echo \"error: something went wrong\" ; exit 1"
check() {
return command -v xbps-install >dev/null 2>&1
}
if check xbps-remove; then
installer="sudo xbps-remove"
elif check pacman; then
installer="sudo pacman -R"
elif check apt; then
installer="sudo apt remove"
elif check dnf; then
installer="sudo dnf remove"
elif check brew; then
installer="brew remove"
else
echo "error: could not find package manager." ; exit 1
fi
$installer $pkgs && echo "done." && exit 0
exit 1