Last active
May 6, 2020 16:32
-
-
Save liam102/f5bf54447d888ea6638ed6d3173641b3 to your computer and use it in GitHub Desktop.
Update Helm CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
WHEREIAM=`cd $(dirname $BASH_SOURCE) && pwd` | |
MY_PATH="${HOME}/App" | |
HELM_VERSION=$1 | |
ZFILE="helm-v${HELM_VERSION}-darwin-amd64.tar.gz" | |
if [[ -z "$HELM_VERSION" ]]; then | |
echo "Current Helm version: " | |
helm version | |
exit 0 | |
fi | |
cd $WHEREIAM | |
wget "https://get.helm.sh/helm-v${HELM_VERSION}-darwin-amd64.tar.gz" | |
if [[ ! -f "$ZFILE" ]]; then | |
echo ">> VERSION ${HELM_VERSION} NOT FOUND" | |
exit 1 | |
fi | |
tar -xf $ZFILE | |
mv darwin-amd64/helm $MY_PATH | |
rm -r darwin-amd64 | |
rm $ZFILE | |
cd - > /dev/null | |
if [[ $? == 0 ]]; then | |
echo "Helm is upgraded >> $(helm version)" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment