mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 19:45:29 +00:00
Add ACCESSIBLE env var support for 'install.sh'
If environment variable ACCESSIBLE is set to a nonempty value, suppress output of `curl` or `wget`
This commit is contained in:
parent
40cee89bab
commit
942fef8ba1
11
install.sh
11
install.sh
@ -7,6 +7,10 @@ DOWNLOAD_LOCATION="/tmp/ouch-binary"
|
|||||||
INSTALLATION_LOCATION="/usr/local/bin/ouch"
|
INSTALLATION_LOCATION="/usr/local/bin/ouch"
|
||||||
REPO_URL="https://github.com/ouch-org/ouch"
|
REPO_URL="https://github.com/ouch-org/ouch"
|
||||||
|
|
||||||
|
# If env var ACCESSIBLE is set (to a nonempty value), suppress output of
|
||||||
|
# `curl` or `wget`
|
||||||
|
|
||||||
|
|
||||||
# Panics script if anything fails
|
# Panics script if anything fails
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
@ -55,12 +59,15 @@ install() {
|
|||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Set $downloader
|
# Set $downloader
|
||||||
|
downloader_quiet_flag=""
|
||||||
if [ $(which curl) ]; then
|
if [ $(which curl) ]; then
|
||||||
downloader="curl"
|
downloader="curl"
|
||||||
downloader_command="curl -fSL $binary_url -o $DOWNLOAD_LOCATION"
|
if [ "$ACCESSIBLE" ]; then downloader_quiet_flag="--silent"; fi
|
||||||
|
downloader_command="curl $downloader_quiet_flag -fSL $binary_url -o $DOWNLOAD_LOCATION"
|
||||||
elif [ $(which wget) ]; then
|
elif [ $(which wget) ]; then
|
||||||
downloader="wget"
|
downloader="wget"
|
||||||
downloader_command="wget $binary_url -O $DOWNLOAD_LOCATION"
|
if [ "$ACCESSIBLE" ]; then downloader_quiet_flag="--quiet"; fi
|
||||||
|
downloader_command="wget $downloader_quiet_flag $binary_url -O $DOWNLOAD_LOCATION"
|
||||||
else
|
else
|
||||||
echo "ERROR: have not found 'curl' nor 'wget' to donwload ouch binary."
|
echo "ERROR: have not found 'curl' nor 'wget' to donwload ouch binary."
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user