From c29962d8b3f5afda61fee7c3984ece8007f184d8 Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 1 Apr 2025 20:25:27 +0200 Subject: [PATCH] Add sys/user-uninstall.sh script ##build --- sys/user-uninstall.sh | 8 ++++++++ sys/user.sh | 32 ++++++++++++++++---------------- 2 files changed, 24 insertions(+), 16 deletions(-) create mode 100755 sys/user-uninstall.sh diff --git a/sys/user-uninstall.sh b/sys/user-uninstall.sh new file mode 100755 index 0000000000..2ceff29061 --- /dev/null +++ b/sys/user-uninstall.sh @@ -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}" diff --git a/sys/user.sh b/sys/user.sh index aca771e6d4..ad5546a666 100755 --- a/sys/user.sh +++ b/sys/user.sh @@ -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