pacstrap: error out earlier, on invalid directory

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
Emil Velikov 2023-03-24 21:05:28 +00:00
parent 8af3fa3b8e
commit c72a394de7

View File

@ -130,7 +130,11 @@ done
shift $(( OPTIND - 1 ))
(( $# )) || die "No root directory specified"
newroot=$1; shift
newroot=$1
shift
[[ -d $newroot ]] || die "%s is not a directory" "$newroot"
pacman_args+=("$pacmode" "${@:-base}" --config="$pacman_config")
if (( ! hostcache )); then
@ -141,8 +145,6 @@ if (( ! interactive )); then
pacman_args+=(--noconfirm)
fi
[[ -d $newroot ]] || die "%s is not a directory" "$newroot"
if (( unshare )); then
setup=unshare_setup
$mount_unshare bash -c "$(declare_all); pacstrap"