mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-11 10:00:23 +08:00
fix: install package on MinGW64
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
- 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
|
- fix #1336: extract package with tar in Windows
|
||||||
|
- fix: install package on MinGW64
|
||||||
|
|
||||||
## v4.1.1 (2022-05-31)
|
## v4.1.1 (2022-05-31)
|
||||||
|
|
||||||
|
|||||||
@@ -44,24 +44,37 @@ function main() {
|
|||||||
echo "$version"
|
echo "$version"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
echo "Latest version: $version"
|
||||||
|
|
||||||
os=$(get_os)
|
os=$(get_os)
|
||||||
echo "Current OS: $os"
|
echo "Current OS: $os"
|
||||||
|
if [[ $os == mingw* ]]; then
|
||||||
|
echoWarn "Current OS is MinGW, try to use windows package"
|
||||||
|
os="windows"
|
||||||
|
fi
|
||||||
|
|
||||||
arch=$(get_arch)
|
arch=$(get_arch)
|
||||||
echo "Current ARCH: $arch"
|
echo "Current ARCH: $arch"
|
||||||
pkg_suffix=".tar.gz"
|
pkg_suffix=".tar.gz"
|
||||||
pkg="hrp-$version-$os-$arch$pkg_suffix"
|
pkg="hrp-$version-$os-$arch$pkg_suffix"
|
||||||
|
echo "Download package: $pkg"
|
||||||
|
|
||||||
# download from aliyun OSS
|
# download from aliyun OSS or github packages
|
||||||
url="https://httprunner.oss-cn-beijing.aliyuncs.com/$pkg"
|
aliyun_oss_url="https://httprunner.oss-cn-beijing.aliyuncs.com/$pkg"
|
||||||
if ! curl --output /dev/null --silent --head --fail "$url"; then
|
github_url="https://github.com/httprunner/httprunner/releases/download/$version/$pkg"
|
||||||
# aliyun OSS url is invalid, try to download from github
|
valid_flag=false
|
||||||
version=$(get_latest_version)
|
for url in "$aliyun_oss_url" "$github_url"; do
|
||||||
pkg="hrp-$version-$os-$arch$pkg_suffix"
|
if curl --output /dev/null --silent --head --fail "$url"; then
|
||||||
url="https://github.com/httprunner/httprunner/releases/download/$version/$pkg"
|
valid_flag=true
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echoWarn "Invalid download url: $url"
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ "$valid_flag" == false ]]; then
|
||||||
|
echoError "No available download url found, exit!"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Latest version: $version"
|
|
||||||
echo "Download url: $url"
|
echo "Download url: $url"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user