output installer permissions message after version check

This commit is contained in:
CJ van den Berg 2025-04-14 19:57:00 +02:00
parent ac54438fbe
commit 3f535d15e0
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -88,21 +88,6 @@ if [ -z "$need_sudo" ] && [ -e "$install_dir/f" ]; then
fi
fi
if [ "$use_sudo" -eq 0 ] && [ -n "$need_sudo" ]; then
printf "%s is not writable. Permissions will be requested with sudo.\n" "$need_sudo"
use_sudo=1
fi
SUDOCMD=""
if [ -n "$need_sudo" ]; then
if [ "$use_sudo" -eq 1 ]; then
SUDOCMD=sudo
else
echo "error: '$need_sudo' is not writable."
exit 1
fi
fi
# prompt for nightly build option if interactive
if [ "$nightly" -eq 0 ] && [ "$have_term" -eq 1 ]; then
printf "do you want to install a Nightly build? [y/N]: "
@ -172,6 +157,21 @@ if [ "$force_update" -eq 0 ] && [ -e "$install_dir/flow" ]; then
fi
fi
if [ "$use_sudo" -eq 0 ] && [ -n "$need_sudo" ]; then
printf "%s is not writable. Permissions will be requested with sudo.\n" "$need_sudo"
use_sudo=1
fi
SUDOCMD=""
if [ -n "$need_sudo" ]; then
if [ "$use_sudo" -eq 1 ]; then
SUDOCMD=sudo
else
echo "error: '$need_sudo' is not writable."
exit 1
fi
fi
# construct download url
# note: nightly assets are named like "flow-<version>-<os>-<arch>.<ext>"
filename="flow-$version-$os-$arch"