8000 pacstrap: error out earlier, on invalid directory · archlinux/arch-install-scripts@c72a394 · GitHub
[go: up one dir, main page]

Skip to content

Commit c72a394

Browse files
committed
pacstrap: error out earlier, on invalid directory
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
1 parent 8af3fa3 commit c72a394

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pacstrap.in

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ done
130130
shift $(( OPTIND - 1 ))
131131

132132
(( $# )) || die "No root directory specified"
133-
newroot=$1; shift
133+
newroot=$1
134+
shift
135+
136+
[[ -d $newroot ]] || die "%s is not a directory" "$newroot"
137+
134138
pacman_args+=("$pacmode" "${@:-base}" --config="$pacman_config")
135139

136140
if (( ! hostcache )); then
@@ -141,8 +145,6 @@ if (( ! interactive )); then
141145
pacman_args+=(--noconfirm)
142146
fi
143147

144-
[[ -d $newroot ]] || die "%s is not a directory" "$newroot"
145-
146148
if (( unshare )); then
147149
setup=unshare_setup
148150
$mount_unshare bash -c "$(declare_all); pacstrap"

0 commit comments

Comments
 (0)
0