run shfmt on installer
This commit is contained in:
parent
30d1c9ee11
commit
2844db19a4
1 changed files with 55 additions and 41 deletions
28
install
28
install
|
@ -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>"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue