Skip to content

Commit 23eda93

Browse files
committed
Fix install-binary script for helm 3
1 parent 6c3bc7d commit 23eda93

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

install-binary.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
PROJECT_NAME="helm-diff"
66
PROJECT_GH="databus23/$PROJECT_NAME"
77

8-
: ${HELM_PLUGIN_PATH:="$(helm home --debug=false)/plugins/helm-diff"}
8+
: ${HELM_PLUGIN_DIR:="$(helm home --debug=false)/plugins/helm-diff"}
99

10-
# Convert the HELM_PLUGIN_PATH to unix if cygpath is
10+
# Convert the HELM_PLUGIN_DIR to unix if cygpath is
1111
# available. This is the case when using MSYS2 or Cygwin
1212
# on Windows where helm returns a Windows path but we
1313
# need a Unix path
1414

1515
if type cygpath > /dev/null 2>&1; then
16-
HELM_PLUGIN_PATH=$(cygpath -u $HELM_PLUGIN_PATH)
16+
HELM_PLUGIN_DIR=$(cygpath -u $HELM_PLUGIN_DIR)
1717
fi
1818

1919
if [[ $SKIP_BIN_INSTALL == "1" ]]; then
@@ -66,7 +66,7 @@ verifySupported() {
6666

6767
# getDownloadURL checks the latest available version.
6868
getDownloadURL() {
69-
local version=$(git -C $HELM_PLUGIN_PATH describe --tags --exact-match 2>/dev/null)
69+
local version=$(git -C $HELM_PLUGIN_DIR describe --tags --exact-match 2>/dev/null)
7070
if [ -n "$version" ]; then
7171
DOWNLOAD_URL="https://github.com/$PROJECT_GH/releases/download/$version/helm-diff-$OS.tgz"
7272
else
@@ -99,9 +99,9 @@ installFile() {
9999
mkdir -p "$HELM_TMP"
100100
tar xf "$PLUGIN_TMP_FILE" -C "$HELM_TMP"
101101
HELM_TMP_BIN="$HELM_TMP/diff/bin/diff"
102-
echo "Preparing to install into ${HELM_PLUGIN_PATH}"
103-
mkdir -p "$HELM_PLUGIN_PATH/bin"
104-
cp "$HELM_TMP_BIN" "$HELM_PLUGIN_PATH/bin"
102+
echo "Preparing to install into ${HELM_PLUGIN_DIR}"
103+
mkdir -p "$HELM_PLUGIN_DIR/bin"
104+
cp "$HELM_TMP_BIN" "$HELM_PLUGIN_DIR/bin"
105105
}
106106

107107
# fail_trap is executed if an error occurs.
@@ -117,8 +117,8 @@ fail_trap() {
117117
# testVersion tests the installed client to make sure it is working.
118118
testVersion() {
119119
set +e
120-
echo "$PROJECT_NAME installed into $HELM_PLUGIN_PATH/$PROJECT_NAME"
121-
"${HELM_PLUGIN_PATH}/bin/diff" -h
120+
echo "$PROJECT_NAME installed into $HELM_PLUGIN_DIR/$PROJECT_NAME"
121+
"${HELM_PLUGIN_DIR}/bin/diff" -h
122122
set -e
123123
}
124124

0 commit comments

Comments
 (0)