From 16da542f1d2d1fdc19c121fc4de2ba75da8c85b4 Mon Sep 17 00:00:00 2001 From: pvincent Date: Mon, 24 Aug 2026 16:29:55 +0400 Subject: [PATCH] return instead of exit --- install.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index e19a94c..ff3e65b 100755 --- a/install.sh +++ b/install.sh @@ -37,7 +37,7 @@ function assert_supported_distro { distro=$(grep -oP '^ID=\K(.*)' /etc/os-release) >&2 echo "unsupported GNU/Linux distribution: $distro" >&2 echo 'only debian-like OR arch-like currently supported' - exit 2 + exit fi } @@ -54,13 +54,15 @@ function execute_miaou_lib { function assert_bash { if [[ $SHELL != bash ]]; then >&2 echo "you are running on SHELL=$SHELL. Bash expected!" - return 98 + exit fi } function sudo_root { - [[ "$UID" -ne 0 ]] && sudo -vp 'SUDO privilege required: ' - true + if [[ "$UID" -ne 0 ]] && ! sudo -vp 'SUDO privilege required: '; then + >&2 echo "canceled" + exit + fi } ## MAIN