From 5d5231e8868a8dc295c00f8ab060b597619d1527 Mon Sep 17 00:00:00 2001 From: southerntofu Date: Fri, 27 Nov 2020 18:48:06 +0100 Subject: [PATCH] Unify missing basedir error --- forgebuild.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/forgebuild.sh b/forgebuild.sh index cdaf9f7..21f8bb7 100755 --- a/forgebuild.sh +++ b/forgebuild.sh @@ -257,11 +257,6 @@ FOUND_BASEDIR=0 for arg in "$@"; do if [ $FOUND_BASEDIR -eq 1 ]; then BASEDIR="$(readlink -m $arg)" - if [ ! -d $BASEDIR ]; then - i18n_basedir="$BASEDIR" - error "missing_basedir" - exit 1 - fi FOUND_BASEDIR=0 elif [[ "$arg" = "-f" ]] || [[ "$arg" = "--force" ]]; then info force_flag @@ -298,10 +293,11 @@ for arg in "$@"; do fi done -# Still the default BASEDIR, if it doesn't exist we create it as a convenience +# Error when the requested basedir (or the default ~/.forgebuild) does not exist if [ ! -d $BASEDIR ]; then - echo "ERROR: No such basedir: $BASEDIR. Creating it and aborting" - exit 1 + i18n_basedir="$BASEDIR" + error "missing_basedir" + exit 1 fi # So scripts can know we're still running (for autoupdater)