Skip to content

Commit

Permalink
fix(webinstall): Ask to create directory path before installing (unik…
Browse files Browse the repository at this point in the history
…raft#765)

Reviewed-by: Alexander Jung <alex@unikraft.io>
Approved-by: Alexander Jung <alex@unikraft.io>
  • Loading branch information
nderjung authored Sep 4, 2023
2 parents b94950b + b39e155 commit 356311f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tools/webinstall/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ YUM=${YUM:-yum}
APT=${APT:-apt-get}
APK=${APK:-apk}
MAKEPKG=${MAKEPKG:-makepkg}
MKDIR=${MKDIR:-mkdir}
GIT=${GIT:-git}
TAR=${TAR:-tar}
PACMAN=${PACMAN:-pacman}
Expand Down Expand Up @@ -1162,6 +1163,19 @@ install_linux_manual() {
err "fatal: choose either yes or no."
fi

if [ ! -d "$PREFIX" ]; then
get_user_response "prefix does not exist, create? [y/N]: " "n"
_ill_answer="$_RETVAL"

if printf "%s" "$_ill_answer" | "$GREP" -q -E "$_NO_ANS_DEFAULT"; then
err "fatal: prefix does not exist."
elif printf "%s" "$_ill_answer" | "$GREP" -q -E "$_YES_ANS"; then
do_cmd "$MKDIR -p $PREFIX"
else
err "fatal: choose either yes or no."
fi
fi

_ill_binary="kraft"
_ill_archive="kraftkit.tar.gz"
downloader "$_ill_url" "$_ill_archive" "$_ill_arch"
Expand Down

0 comments on commit 356311f

Please sign in to comment.