Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion install-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ if [ "$SKIP_BIN_INSTALL" = "1" ]; then
exit
fi

# which mode is the common installer script running in
SCRIPT_MODE="install"
if [ "$1" = "-u" ]; then
SCRIPT_MODE="update"
fi

# initArch discovers the architecture for this system.
initArch() {
ARCH=$(uname -m)
Expand Down Expand Up @@ -76,7 +82,7 @@ verifySupported() {
# getDownloadURL checks the latest available version.
getDownloadURL() {
version=$(git -C "$HELM_PLUGIN_DIR" describe --tags --exact-match 2>/dev/null || :)
if [ -n "$version" ]; then
if [ "$SCRIPT_MODE" = "install" -a -n "$version" ]; then
DOWNLOAD_URL="https://github.com/$PROJECT_GH/releases/download/$version/helm-diff-$OS-$ARCH.tgz"
else
DOWNLOAD_URL="https://github.com/$PROJECT_GH/releases/latest/download/helm-diff-$OS-$ARCH.tgz"
Expand Down
2 changes: 1 addition & 1 deletion plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ useTunnel: true
command: "$HELM_PLUGIN_DIR/bin/diff"
hooks:
install: "$HELM_PLUGIN_DIR/install-binary.sh"
update: "$HELM_PLUGIN_DIR/install-binary.sh"
update: "$HELM_PLUGIN_DIR/install-binary.sh -u"