Merge pull request #65 from httprunner/fix-install

fix: install with shell

- fix: ignore insecure in curl
- fix: mktemp: too few X's in template
This commit is contained in:
debugtalk
2022-01-20 14:29:44 +08:00
committed by GitHub
2 changed files with 13 additions and 6 deletions

View File

@@ -29,7 +29,10 @@ See [CHANGELOG].
You can install `hrp` with one shell command, which will download the latest version's released binary and install to the current system. You can install `hrp` with one shell command, which will download the latest version's released binary and install to the current system.
```bash ```bash
$ curl -sL https://raw.githubusercontent.com/httprunner/hrp/main/cli/scripts/install.sh | bash # install via curl
$ bash -c "$(curl -ksSL https://raw.githubusercontent.com/httprunner/hrp/main/cli/scripts/install.sh)"
# install via wget
$ bash -c "$(wget https://raw.githubusercontent.com/httprunner/hrp/main/cli/scripts/install.sh -O -)"
``` ```
If you are a golang developer, you can also install `hrp` with `go get`. If you are a golang developer, you can also install `hrp` with `go get`.

View File

@@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# install hrp with one shell command # install hrp with one shell command
# curl -sL https://raw.githubusercontent.com/httprunner/hrp/main/cli/scripts/install.sh | bash # bash -c "$(curl -ksSL https://raw.githubusercontent.com/httprunner/hrp/main/cli/scripts/install.sh)"
set -e set -e
@@ -46,17 +46,21 @@ function main() {
echo echo
echoInfo "Created temp dir..." echoInfo "Created temp dir..."
tmp_dir=$(mktemp -d -t hrp) echo "$ mktemp -d -t hrp.XXXX"
tmp_dir=$(mktemp -d -t hrp.XXXX)
echo "$tmp_dir" echo "$tmp_dir"
cd "$tmp_dir" cd "$tmp_dir"
echo echo
echoInfo "Downloading..." echoInfo "Downloading..."
curl -L $url -o "$pkg" echo "$ curl -kL $url -o $pkg"
curl -kL $url -o "$pkg"
echo echo
echoInfo "Extracting..." echoInfo "Extracting..."
tar -zxf "$pkg" echo "$ tar -xzf $pkg"
tar -xzf "$pkg"
echo "$ ls -lh"
ls -lh ls -lh
echo echo
@@ -67,7 +71,7 @@ function main() {
rm -rf "$(which hrp)" rm -rf "$(which hrp)"
fi fi
echo "chmod +x hrp && mv hrp /usr/local/bin/" echo "$ chmod +x hrp && mv hrp /usr/local/bin/"
chmod +x hrp chmod +x hrp
mv hrp /usr/local/bin/ mv hrp /usr/local/bin/
echo echo