From 10628d485848d071472325d9f0aab780108d6013 Mon Sep 17 00:00:00 2001 From: vx_clutch <98831688+vx-clutch@users.noreply.github.com> Date: Tue, 9 Sep 2025 12:13:59 -0400 Subject: [PATCH] Create pkg-remove --- bin/.local/bin/pkg-remove | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 bin/.local/bin/pkg-remove diff --git a/bin/.local/bin/pkg-remove b/bin/.local/bin/pkg-remove new file mode 100644 index 0000000..e8d2455 --- /dev/null +++ b/bin/.local/bin/pkg-remove @@ -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