Unify missing basedir error

This commit is contained in:
southerntofu 2020-11-27 18:48:06 +01:00
parent b3c816b428
commit 5d5231e886
1 changed files with 4 additions and 8 deletions

View File

@ -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)