mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-04 23:16:57 +08:00
fix #1337: install on windows
This commit is contained in:
+25
-11
@@ -78,26 +78,40 @@ function main() {
|
|||||||
echo "Download url: $url"
|
echo "Download url: $url"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echoInfo "Created temp dir..."
|
|
||||||
echo "$ mktemp -d -t hrp.XXXX"
|
|
||||||
tmp_dir=$(mktemp -d -t hrp.XXXX)
|
|
||||||
echo "$tmp_dir"
|
|
||||||
cd "$tmp_dir"
|
|
||||||
echo
|
|
||||||
|
|
||||||
echoInfo "Downloading..."
|
echoInfo "Downloading..."
|
||||||
echo "$ curl -kL $url -o $pkg"
|
echo "$ curl -kL $url -o $pkg"
|
||||||
curl -kL $url -o "$pkg"
|
curl -kL $url -o "$pkg"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echoInfo "Extracting..."
|
# for windows, only extract package to current directory
|
||||||
if [[ $os == windows ]]; then # windows
|
if [[ $os == windows ]]; then # windows
|
||||||
|
# extract to current directory
|
||||||
|
echoInfo "Extracting..."
|
||||||
echo "$ unzip -o $pkg -d ."
|
echo "$ unzip -o $pkg -d ."
|
||||||
unzip -o $pkg -d .
|
unzip -o $pkg -d .
|
||||||
else
|
|
||||||
echo "$ tar -xzf $pkg"
|
echo "$ hrp.exe -v"
|
||||||
tar -xzf "$pkg"
|
hrp.exe -v
|
||||||
|
echo "$ hrp.exe -h"
|
||||||
|
hrp.exe -h
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# for linux or darwin, install hrp to /usr/local/bin
|
||||||
|
# extract to temp directory
|
||||||
|
echoInfo "Created temp dir..."
|
||||||
|
echo "$ mktemp -d -t hrp.XXXX"
|
||||||
|
tmp_dir=$(mktemp -d -t hrp.XXXX)
|
||||||
|
echo "$tmp_dir"
|
||||||
|
echo "$ mv $pkg $tmp_dir && cd $tmp_dir"
|
||||||
|
mv $pkg $tmp_dir
|
||||||
|
cd "$tmp_dir"
|
||||||
|
echo
|
||||||
|
|
||||||
|
echoInfo "Extracting..."
|
||||||
|
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