Skip to content

Commit 19a5207

Browse files
authored
Use cygpath for HELM_BIN (#287)
Since 7f10f25 HELM_BIN instead helm is used. If helm plugin install is running on cygwin, an error occurred: ``` # Installed plugin: secrets ... # D:\a\helm-secrets\helm-secrets\tests\.tmp\cache\CYGWIN_NT-10.0\helm\home\helm\plugins\helm-diff/install-binary.sh: line 9: C:\hostedtoolcache\windows\helm\3.6.0\x64\windows-amd64\helm.exe: command not found ... # Error: plugin install hook for "diff" exited with error ``` Like HELM_PLUGIN_DIR, HELM_BIN needs to be translated on cygwin, too.
1 parent eddde5a commit 19a5207

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

install-binary.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ PROJECT_NAME="helm-diff"
66
PROJECT_GH="databus23/$PROJECT_NAME"
77
export GREP_COLOR="never"
88

9+
# Convert HELM_BIN and HELM_PLUGIN_DIR to unix if cygpath is
10+
# available. This is the case when using MSYS2 or Cygwin
11+
# on Windows where helm returns a Windows path but we
12+
# need a Unix path
13+
14+
if type cygpath >/dev/null 2>&1; then
15+
HELM_BIN="$(cygpath -u "${HELM_BIN}")"
16+
HELM_PLUGIN_DIR="$(cygpath -u "${HELM_PLUGIN_DIR}")"
17+
fi
18+
919
[ -z "$HELM_BIN" ] && HELM_BIN=$(which helm)
1020
HELM_MAJOR_VERSION=$("${HELM_BIN}" version --client --short | awk -F '.' '{print $1}')
1121

@@ -16,15 +26,6 @@ mkdir -p "$HELM_HOME"
1626

1727
: ${HELM_PLUGIN_DIR:="$HELM_HOME/plugins/helm-diff"}
1828

19-
# Convert the HELM_PLUGIN_DIR to unix if cygpath is
20-
# available. This is the case when using MSYS2 or Cygwin
21-
# on Windows where helm returns a Windows path but we
22-
# need a Unix path
23-
24-
if type cygpath >/dev/null 2>&1; then
25-
HELM_PLUGIN_DIR=$(cygpath -u $HELM_PLUGIN_DIR)
26-
fi
27-
2829
if [ "$SKIP_BIN_INSTALL" = "1" ]; then
2930
echo "Skipping binary install"
3031
exit

0 commit comments

Comments
 (0)