run shfmt on installer

This commit is contained in:
CJ van den Berg 2025-02-11 19:25:32 +01:00
parent 30d1c9ee11
commit 2844db19a4
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

28
install
View file

@ -5,13 +5,24 @@ install_dir="/usr/local/bin"
add_alias=0 add_alias=0
nightly=0 nightly=0
while true while true; do
do
case "${1}" in case "${1}" in
-a|--alias) add_alias=1; shift 1;; -a | --alias)
-n|--nightly) nightly=1; shift 1;; add_alias=1
-p|--prefix) install_dir=/$2; shift 2;; shift 1
--) shift 1; break ;; ;;
-n | --nightly)
nightly=1
shift 1
;;
-p | --prefix)
install_dir=/$2
shift 2
;;
--)
shift 1
break
;;
*) break ;; *) break ;;
esac esac
done done
@ -47,7 +58,10 @@ esac
# get latest version tag from github releases api # get latest version tag from github releases api
version=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | grep '"tag_name":' | cut -d'"' -f4) version=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | grep '"tag_name":' | cut -d'"' -f4)
[ -z "$version" ] && { echo "failed to fetch latest version"; exit 1; } [ -z "$version" ] && {
echo "failed to fetch latest version"
exit 1
}
# construct download url # construct download url
# note: nightly assets are named like "flow-<version>-<os>-<arch>.<ext>" # note: nightly assets are named like "flow-<version>-<os>-<arch>.<ext>"