From df212161a23816b5083e3053669b7c7b0af38a99 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Sun, 5 Jun 2022 09:39:45 +0800 Subject: [PATCH] fix #1336: extract package with tar in Windows --- docs/CHANGELOG.md | 1 + scripts/install.sh | 25 +++---------------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 5fcde733..3d5edf9b 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,6 +3,7 @@ ## v4.1.2 (2022-06-03) - fix #1331: use `str_eq` to assert string and digit equality +- fix #1336: extract package with tar in Windows ## v4.1.1 (2022-05-31) diff --git a/scripts/install.sh b/scripts/install.sh index c16f1c05..84f8392b 100644 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -36,26 +36,6 @@ function get_arch() { echo "$arch" } -function get_pkg_suffix() { - os=$1 - if [ "$os" == "windows" ]; then - echo ".zip" - else - echo ".tar.gz" - fi -} - -function extract_pkg() { - pkg=$1 - if [[ $pkg == *.zip ]]; then # windows - echo "$ unzip -o $pkg -d ." - unzip -o $pkg -d . - else - echo "$ tar -xzf $pkg" - tar -xzf "$pkg" - fi -} - function main() { echoInfo "Detect target hrp package..." version=$(get_latest_version) @@ -69,7 +49,7 @@ function main() { echo "Current OS: $os" arch=$(get_arch) echo "Current ARCH: $arch" - pkg_suffix=$(get_pkg_suffix $os) + pkg_suffix=".tar.gz" pkg="hrp-$version-$os-$arch$pkg_suffix" # download from aliyun OSS @@ -98,7 +78,8 @@ function main() { echo echoInfo "Extracting..." - extract_pkg "$pkg" + echo "$ tar -xzf $pkg" + tar -xzf "$pkg" echo "$ ls -lh" ls -lh echo