Add sys/user-uninstall.sh script ##build

This commit is contained in:
pancake 2025-04-01 20:25:27 +02:00
parent b1b1fc5080
commit c29962d8b3
2 changed files with 24 additions and 16 deletions

8
sys/user-uninstall.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
if [ -z "${HOME}" ]; then
echo "Missing HOME environment" > /dev/stderr
exit 1
fi
PREFIX="${HOME}/.local"
make uninstall PREFIX="${PREFIX}"

View file

@ -30,21 +30,22 @@ ARGS=""
while [ $# -gt 0 ]
do
case "$1" in
"--without-pull")
WITHOUT_PULL=1
;;
"--install-path")
shift
if [ -n "$1" ]; then
PREFIX="`abspath $1`"
BINDIR="$PREFIX/bin"
else
echo "ERROR: install-path must not be empty"
exit 1
fi
;;
*)
ARGS="${ARGS} $1"
"--without-pull")
WITHOUT_PULL=1
;;
"--install-path")
shift
if [ -n "$1" ]; then
PREFIX="`abspath $1`"
BINDIR="$PREFIX/bin"
else
echo "ERROR: install-path must not be empty"
exit 1
fi
;;
*)
ARGS="${ARGS} $1"
;;
esac
shift
done
@ -73,7 +74,6 @@ if [ -z "${PREFIX}" ]; then
echo "HOME not set"
exit 1
fi
if [ ! -d "${HOME}" ]; then
echo "HOME is not a directory"
exit 1