feat: add --debug flag to installer to install debug builds
This commit is contained in:
parent
742c9f997e
commit
e6c39acdd6
1 changed files with 21 additions and 0 deletions
|
@ -5,6 +5,7 @@ install_dir="${PREFIX:-/usr/local}/bin"
|
||||||
tmp_path="${TMPDIR:-/tmp}"
|
tmp_path="${TMPDIR:-/tmp}"
|
||||||
add_alias=${ALIAS:-0}
|
add_alias=${ALIAS:-0}
|
||||||
nightly=${NIGHTLY:-0}
|
nightly=${NIGHTLY:-0}
|
||||||
|
debug=${DEBUG:-0}
|
||||||
verify=${VERIFY:-0}
|
verify=${VERIFY:-0}
|
||||||
local=${LOCAL:-0}
|
local=${LOCAL:-0}
|
||||||
use_sudo=${USE_SUDO:-0}
|
use_sudo=${USE_SUDO:-0}
|
||||||
|
@ -15,6 +16,7 @@ usage() {
|
||||||
echo
|
echo
|
||||||
echo " -a, --alias Create/update 'f' alias"
|
echo " -a, --alias Create/update 'f' alias"
|
||||||
echo " -n, --nightly Latest nightly build"
|
echo " -n, --nightly Latest nightly build"
|
||||||
|
echo " -D, --debug Debug build"
|
||||||
echo " -d <path>, --dest <path> Set install destination (default /usr/local/bin)"
|
echo " -d <path>, --dest <path> Set install destination (default /usr/local/bin)"
|
||||||
echo " -V, --verify Verify gpg signature"
|
echo " -V, --verify Verify gpg signature"
|
||||||
echo " -l, --local Verify gpg signature with local keychain"
|
echo " -l, --local Verify gpg signature with local keychain"
|
||||||
|
@ -32,6 +34,10 @@ while true; do
|
||||||
nightly=1
|
nightly=1
|
||||||
shift 1
|
shift 1
|
||||||
;;
|
;;
|
||||||
|
-D | --debug)
|
||||||
|
debug=1
|
||||||
|
shift 1
|
||||||
|
;;
|
||||||
-d | --dest)
|
-d | --dest)
|
||||||
install_dir=$2
|
install_dir=$2
|
||||||
shift 2
|
shift 2
|
||||||
|
@ -97,6 +103,14 @@ if [ "$nightly" -eq 0 ] && [ "$have_term" -eq 1 ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$debug" -eq 0 ] && [ "$have_term" -eq 1 ]; then
|
||||||
|
printf "do you want to install a debug build? [y/N]: "
|
||||||
|
read -r answer_debug
|
||||||
|
if [ "$answer_debug" = "y" ] || [ "$answer_debug" = "Y" ]; then
|
||||||
|
debug=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$verify" -eq 0 ] && [ "$have_term" -eq 1 ]; then
|
if [ "$verify" -eq 0 ] && [ "$have_term" -eq 1 ]; then
|
||||||
printf "do you want to download and verify the gpg signature? [y/N]: "
|
printf "do you want to download and verify the gpg signature? [y/N]: "
|
||||||
read -r answer_verify
|
read -r answer_verify
|
||||||
|
@ -145,6 +159,10 @@ version=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | grep '"
|
||||||
}
|
}
|
||||||
title="$title $version"
|
title="$title $version"
|
||||||
|
|
||||||
|
if [ "$debug" -eq 1 ]; then
|
||||||
|
title="$title (debug)"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$force_update" -eq 0 ] && [ -e "$install_dir/flow" ]; then
|
if [ "$force_update" -eq 0 ] && [ -e "$install_dir/flow" ]; then
|
||||||
current_version=$(flow --version 2>/dev/null | grep version: | cut -f2 -d ' ')
|
current_version=$(flow --version 2>/dev/null | grep version: | cut -f2 -d ' ')
|
||||||
if [ "$current_version" = "$version" ]; then
|
if [ "$current_version" = "$version" ]; then
|
||||||
|
@ -179,6 +197,9 @@ ext="tar.gz"
|
||||||
if [ "$os" = "windows" ]; then
|
if [ "$os" = "windows" ]; then
|
||||||
ext="zip"
|
ext="zip"
|
||||||
fi
|
fi
|
||||||
|
if [ "$debug" -eq 1 ]; then
|
||||||
|
filename="$filename-debug"
|
||||||
|
fi
|
||||||
url="https://github.com/$repo/releases/download/$version/$filename.$ext"
|
url="https://github.com/$repo/releases/download/$version/$filename.$ext"
|
||||||
|
|
||||||
echo "downloading $title..."
|
echo "downloading $title..."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue