From c4828969456acdb59c16208a3e5f9232f71fcc81 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 3 May 2020 09:58:52 +0000 Subject: [PATCH] fixes and cleanup --- golang/golang.bash | 4 ++-- macos/macos.bash | 13 +++++++++---- node/node.bash | 4 ++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/golang/golang.bash b/golang/golang.bash index e5f09d1..ad14c15 100644 --- a/golang/golang.bash +++ b/golang/golang.bash @@ -117,7 +117,7 @@ popd 2>&1 >/dev/null ################### # TODO get better output from pathman / output the path to add as return to webi bootstrap -pathman add "$new_go_home" -pathman add "$HOME/go/bin/" +pathman add "$new_go_home/bin" +pathman add "$HOME/go/bin" echo "Installed 'go' (and go tools)" echo "" diff --git a/macos/macos.bash b/macos/macos.bash index 9765629..6e7582f 100644 --- a/macos/macos.bash +++ b/macos/macos.bash @@ -17,11 +17,8 @@ set -u if [ -z "${WEBI_PKG_URL:-}" ]; then # dmg release_tab="${WEBI_HOST}/api/releases/macos@${WEBI_VERSION:-}.csv?os=$(uname -s)&arch=$(uname -m)&limit=1" - echo $release_tab WEBI_CSV=$(curl -fsSL "$release_tab" -H "User-Agent: $(uname -a)") - echo $WEBI_CSV WEBI_CHANNEL=$(echo $WEBI_CSV | cut -d ',' -f 3) - echo $WEBI_CHANNEL if [ "error" == "$WEBI_CHANNEL" ]; then echo "could not find release for macOS v${WEBI_VERSION}" exit 1 @@ -33,7 +30,15 @@ fi mkdir -p ~/Downloads pushd ~/Downloads 2>&1 >/dev/null -wget -c "$WEBI_PKG_URL" +# TODO use downloads directory because this is big +set +e +if [ -n "$(command -v wget)" ]; then + # better progress bar + wget -c "${WEBI_PKG_URL}" +else + curl -fL "${WEBI_PKG_URL}" -o "$(echo "${WEBI_PKG_FILE}" | sed 's:.*/::' )" +fi +set -e if [ "Darwin" == "$(uname -s)" ]; then curl -fsSL 'https://gist.githubusercontent.com/solderjs/8c36d132250163011c83bad8284975ee/raw/5a291955813743c20c12ca2d35c7b1bb34f8aecc/create-bootable-installer-for-os-x-el-capitan.sh' -o create-bootable-installer-for-os-x-el-capitan.sh diff --git a/node/node.bash b/node/node.bash index f4158d8..89cb7c1 100644 --- a/node/node.bash +++ b/node/node.bash @@ -55,9 +55,9 @@ my_tmp=${WEBI_TMP:-$(mktemp -d node-install.XXXXXX)} sudo_cmd=${WEBI_SUDO:-} http_get() { - if [ -n "$(command -v curl 2>/dev/null | grep curl)" ]; then + if [ -n "$(command -v curl)" ]; then curl -fsSL $1 -o $2 || echo 'error downloading node' - elif [ -n "$(command -v wget 2>/dev/null | grep wget)" ]; then + elif [ -n "$(command -v wget)" ]; then wget --quiet $1 -O $2 || echo 'error downloading node' else echo "'wget' and 'curl' are missing. Please run the following command and try again" -- 2.25.1