mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 07:26:55 +08:00
fix #1336: extract package with tar in Windows
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
## v4.1.2 (2022-06-03)
|
## v4.1.2 (2022-06-03)
|
||||||
|
|
||||||
- fix #1331: use `str_eq` to assert string and digit equality
|
- 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)
|
## v4.1.1 (2022-05-31)
|
||||||
|
|
||||||
|
|||||||
+3
-22
@@ -36,26 +36,6 @@ function get_arch() {
|
|||||||
echo "$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() {
|
function main() {
|
||||||
echoInfo "Detect target hrp package..."
|
echoInfo "Detect target hrp package..."
|
||||||
version=$(get_latest_version)
|
version=$(get_latest_version)
|
||||||
@@ -69,7 +49,7 @@ function main() {
|
|||||||
echo "Current OS: $os"
|
echo "Current OS: $os"
|
||||||
arch=$(get_arch)
|
arch=$(get_arch)
|
||||||
echo "Current ARCH: $arch"
|
echo "Current ARCH: $arch"
|
||||||
pkg_suffix=$(get_pkg_suffix $os)
|
pkg_suffix=".tar.gz"
|
||||||
pkg="hrp-$version-$os-$arch$pkg_suffix"
|
pkg="hrp-$version-$os-$arch$pkg_suffix"
|
||||||
|
|
||||||
# download from aliyun OSS
|
# download from aliyun OSS
|
||||||
@@ -98,7 +78,8 @@ function main() {
|
|||||||
echo
|
echo
|
||||||
|
|
||||||
echoInfo "Extracting..."
|
echoInfo "Extracting..."
|
||||||
extract_pkg "$pkg"
|
echo "$ tar -xzf $pkg"
|
||||||
|
tar -xzf "$pkg"
|
||||||
echo "$ ls -lh"
|
echo "$ ls -lh"
|
||||||
ls -lh
|
ls -lh
|
||||||
echo
|
echo
|
||||||
|
|||||||
Reference in New Issue
Block a user