updated uninstall

This commit is contained in:
ronny abraham 2025-05-12 04:41:33 +03:00
parent 5909ed8158
commit 7b03c15879

View file

@ -1,8 +1,9 @@
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
ROOT_SRC=".." DEBUG=false
ROOT_SRC=".."
TARGET_NAME="convert-dirs" TARGET_NAME="convert-dirs"
PREFIX="${PREFIX:-/usr/local}" PREFIX="${PREFIX:-/usr/local}"
@ -10,6 +11,10 @@ INSTALL_PATH="$PREFIX/bin/$TARGET_NAME"
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case "$1" in case "$1" in
--debug)
DEBUG=true
shift
;;
--prefix) --prefix)
PREFIX="$2" PREFIX="$2"
INSTALL_PATH="$PREFIX/bin/$TARGET_NAME" INSTALL_PATH="$PREFIX/bin/$TARGET_NAME"
@ -26,6 +31,13 @@ while [[ $# -gt 0 ]]; do
esac esac
done done
if [[ "$DEBUG" == true ]]; then
echo "ROOT_SRC=$ROOT_SRC"
echo "TARGET_NAME=$TARGET_NAME"
echo "PREFIX=$PREFIX"
echo "INSTALL_PATH=$INSTALL_PATH"
fi
# check and remove # check and remove
if [[ ! -f "$INSTALL_PATH" ]]; then if [[ ! -f "$INSTALL_PATH" ]]; then
echo "$INSTALL_PATH not found. Nothing to uninstall." echo "$INSTALL_PATH not found. Nothing to uninstall."