Skip to content

Commit a3b1708

Browse files
jkroepkemumoshu
andauthored
Fix installation on cygwin (#353)
* Fix cygwin * fixup! Merge branch 'master' into fix-cygwin * fixup! fixup! Merge branch 'master' into fix-cygwin Co-authored-by: Yusuke Kuoka <[email protected]>
1 parent 5f58fc8 commit a3b1708

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

install-binary.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,16 @@ initArch() {
5252

5353
# initOS discovers the operating system for this system.
5454
initOS() {
55-
OS=$(uname | tr '[:upper:]' '[:lower:]')
55+
OS=$(uname -s)
5656

5757
case "$OS" in
5858
# Msys support
59-
msys*) OS='windows' ;;
59+
MSYS*) OS='windows' ;;
6060
# Minimalist GNU for Windows
61-
mingw*) OS='windows' ;;
62-
darwin) OS='macos' ;;
61+
MINGW*) OS='windows' ;;
62+
CYGWIN*) OS='windows' ;;
63+
Darwin) OS='macos' ;;
64+
Linux) OS='linux' ;;
6365
esac
6466
}
6567

@@ -108,18 +110,18 @@ downloadFile() {
108110
if
109111
command -v curl >/dev/null 2>&1
110112
then
111-
curl -L "$DOWNLOAD_URL" -o "$PLUGIN_TMP_FILE"
113+
curl -sSf -L "$DOWNLOAD_URL" >"$PLUGIN_TMP_FILE"
112114
elif
113115
command -v wget >/dev/null 2>&1
114116
then
115-
wget -q -O "$PLUGIN_TMP_FILE" "$DOWNLOAD_URL"
117+
wget -q -O - "$DOWNLOAD_URL" >"$PLUGIN_TMP_FILE"
116118
fi
117119
}
118120

119121
# installFile verifies the SHA256 for the file, then unpacks and
120122
# installs it.
121123
installFile() {
122-
tar xvzf "$PLUGIN_TMP_FILE" -C "$HELM_TMP"
124+
tar xzf "$PLUGIN_TMP_FILE" -C "$HELM_TMP"
123125
HELM_TMP_BIN="$HELM_TMP/diff/bin/diff"
124126
echo "Preparing to install into ${HELM_PLUGIN_DIR}"
125127
mkdir -p "$HELM_PLUGIN_DIR/bin"

0 commit comments

Comments
 (0)