Skip to content

Commit 8a7f38e

Browse files
basscomumoshu
andauthored
fix(upgrade): fix upgrade logic in install script (#309)
Co-authored-by: Yusuke Kuoka <[email protected]>
1 parent 5492efe commit 8a7f38e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

install-binary.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ if [ "$SKIP_BIN_INSTALL" = "1" ]; then
3030
exit
3131
fi
3232

33+
# which mode is the common installer script running in
34+
SCRIPT_MODE="install"
35+
if [ "$1" = "-u" ]; then
36+
SCRIPT_MODE="update"
37+
fi
38+
3339
# initArch discovers the architecture for this system.
3440
initArch() {
3541
ARCH=$(uname -m)
@@ -76,7 +82,7 @@ verifySupported() {
7682
# getDownloadURL checks the latest available version.
7783
getDownloadURL() {
7884
version=$(git -C "$HELM_PLUGIN_DIR" describe --tags --exact-match 2>/dev/null || :)
79-
if [ -n "$version" ]; then
85+
if [ "$SCRIPT_MODE" = "install" -a -n "$version" ]; then
8086
DOWNLOAD_URL="https://github.com/$PROJECT_GH/releases/download/$version/helm-diff-$OS-$ARCH.tgz"
8187
else
8288
DOWNLOAD_URL="https://github.com/$PROJECT_GH/releases/latest/download/helm-diff-$OS-$ARCH.tgz"

plugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ useTunnel: true
88
command: "$HELM_PLUGIN_DIR/bin/diff"
99
hooks:
1010
install: "$HELM_PLUGIN_DIR/install-binary.sh"
11-
update: "$HELM_PLUGIN_DIR/install-binary.sh"
11+
update: "$HELM_PLUGIN_DIR/install-binary.sh -u"

0 commit comments

Comments
 (0)