提交 2b28a53b 编写于 作者: M Mislav Marohnić

Fix `script/get` for `MSYS_NT-*` host

上级 d92a3108
...@@ -22,19 +22,22 @@ fi ...@@ -22,19 +22,22 @@ fi
ARCH="amd64" ARCH="amd64"
OS="$(uname -s | tr '[:upper:]' '[:lower:]')" OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
[[ $OS != mingw* ]] || OS="windows"
download() { download() {
if [ "$OS" = windows ]; then case "$OS" in
mingw* | msys* )
zip="${1%.tgz}.zip" zip="${1%.tgz}.zip"
curl -fsSLO "$zip" curl -fsSLO "$zip"
unzip "$(basename "$zip")" bin/hub.exe unzip "$(basename "$zip")" bin/hub.exe
rm -f "$zip" rm -f "$zip"
elif [ "$OS" = darwin ]; then ;;
darwin )
curl -fsSL "$1" | tar xz --strip-components=1 '*/bin/hub' curl -fsSL "$1" | tar xz --strip-components=1 '*/bin/hub'
else ;;
* )
curl -fsSL "$1" | tar xz --strip-components=1 --wildcards '*/bin/hub' curl -fsSL "$1" | tar xz --strip-components=1 --wildcards '*/bin/hub'
fi ;;
esac
} }
download "https://github.com/github/hub/releases/download/v$HUB_VERSION/hub-$OS-$ARCH-$HUB_VERSION.tgz" download "https://github.com/github/hub/releases/download/v$HUB_VERSION/hub-$OS-$ARCH-$HUB_VERSION.tgz"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册