projects
/
webi-installers
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b86d401
)
don't show progress for non-interactive sessions
author
AJ ONeal
<aj@therootcompany.com>
Thu, 19 Nov 2020 04:51:34 +0000
(
04:51
+0000)
committer
AJ ONeal
<coolaj86@gmail.com>
Wed, 2 Dec 2020 20:23:53 +0000
(13:23 -0700)
_webi/template.sh
patch
|
blob
|
history
diff --git
a/_webi/template.sh
b/_webi/template.sh
index a041e41ac3b530cddc2461f8743ef7fd1e855401..643be6ccaa1852fe81312b45857c4aecfdd83327 100644
(file)
--- a/
_webi/template.sh
+++ b/
_webi/template.sh
@@
-156,7
+156,11
@@
webi_download() {
# wget has resumable downloads
# TODO wget -c --content-disposition "$my_url"
set +e
# wget has resumable downloads
# TODO wget -c --content-disposition "$my_url"
set +e
- wget -q --show-progress --user-agent="wget $WEBI_UA" -c "$my_url" -O "$my_dl.part"
+ my_show_progress=""
+ if [[ $- == *i* ]]; then
+ my_show_progress="--show-progress"
+ fi
+ wget -q $my_show_progress --user-agent="wget $WEBI_UA" -c "$my_url" -O "$my_dl.part"
if ! [ $? -eq 0 ]; then
>&2 echo "failed to download from $WEBI_PKG_URL"
exit 1
if ! [ $? -eq 0 ]; then
>&2 echo "failed to download from $WEBI_PKG_URL"
exit 1
@@
-165,7
+169,11
@@
webi_download() {
else
# Neither GNU nor BSD curl have sane resume download options, hence we don't bother
# TODO curl -fsSL --remote-name --remote-header-name --write-out "$my_url"
else
# Neither GNU nor BSD curl have sane resume download options, hence we don't bother
# TODO curl -fsSL --remote-name --remote-header-name --write-out "$my_url"
- curl -fSL -H "User-Agent: curl $WEBI_UA" "$my_url" -o "$my_dl.part"
+ my_show_progress="-#"
+ if [[ $- == *i* ]]; then
+ my_show_progress=""
+ fi
+ curl -fSL $my_show_progress -H "User-Agent: curl $WEBI_UA" "$my_url" -o "$my_dl.part"
fi
mv "$my_dl.part" "$my_dl"
fi
mv "$my_dl.part" "$my_dl"