File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ info_echo ">> Going to download release asset '$gh_release_asset'"
112
112
113
113
# We don't want the nested variables to expand
114
114
# shellcheck disable=SC2016
115
- _script=' wget ' " $( echo " $item " | jq -r ' .browser_download_url' | head -1) " ' && ' $unarchive_cmd ' "$gh_release_asset"'
115
+ _script=' download ' " $( echo " $item " | jq -r ' .browser_download_url' | head -1) " ' && ' $unarchive_cmd ' "$gh_release_asset"'
116
116
execute_hooks " downloading gh-release" " $target_folder " " $_script "
117
117
118
118
Original file line number Diff line number Diff line change @@ -144,6 +144,16 @@ gh_release_check_up_to_date() {
144
144
return 0
145
145
}
146
146
147
+ download () {
148
+ if command_exists wget; then
149
+ wget " $@ "
150
+ elif command_exists curl; then
151
+ curl -LOJ " $@ "
152
+ else
153
+ error_echo " No download tool found"
154
+ exit 1
155
+ fi
156
+ }
147
157
clear_prev_lines () {
148
158
if [ -n " $SHSH_USE_TPUT " ]; then
149
159
# clear all lines at once (ed clear from current to end of screen)
@@ -564,7 +574,7 @@ if ! command_exists jq; then
564
574
# bootstrap jq
565
575
if prompt " >> jq is needed but not found. Bootstrap by downloading a binary release?" ; then
566
576
set -e
567
- shsh install _bootstrap/jq --plain -h pre=" wget https://github.com/stedolan/jq/releases/download/jq-1.6/$bin_name " -v BINS=' '
577
+ shsh install _bootstrap/jq --plain -h pre=" download https://github.com/stedolan/jq/releases/download/jq-1.6/$bin_name " -v BINS=' '
568
578
569
579
chmod +x " $SHSH_PACKAGES_PATH /_bootstrap/jq/$bin_name "
570
580
else
You can’t perform that action at this time.
0 commit comments