From 2660d576b49f3b94f684d74130bff6ed523cbee9 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Thu, 20 Jan 2022 14:09:09 +0800 Subject: [PATCH 1/3] fix: install with shell --- README.md | 5 ++++- cli/scripts/install.sh | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4dcc78d1..509de57b 100644 --- a/README.md +++ b/README.md @@ -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. ```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`. diff --git a/cli/scripts/install.sh b/cli/scripts/install.sh index b76f0adc..d8e90fd8 100644 --- a/cli/scripts/install.sh +++ b/cli/scripts/install.sh @@ -1,6 +1,6 @@ #!/bin/bash # 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 @@ -46,17 +46,20 @@ function main() { echo echoInfo "Created temp dir..." + echo "$ mktemp -d -t hrp" tmp_dir=$(mktemp -d -t hrp) echo "$tmp_dir" cd "$tmp_dir" echo echoInfo "Downloading..." - curl -L $url -o "$pkg" + echo "$ curl -kL $url -o $pkg" + curl -kL $url -o "$pkg" echo echoInfo "Extracting..." - tar -zxf "$pkg" + echo "$ tar -xzf $pkg" + tar -xzf "$pkg" ls -lh echo From b31fa0aab882da58b0c31e0c505453f6aa0267af Mon Sep 17 00:00:00 2001 From: debugtalk Date: Thu, 20 Jan 2022 14:16:56 +0800 Subject: [PATCH 2/3] change: update script --- cli/scripts/install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/scripts/install.sh b/cli/scripts/install.sh index d8e90fd8..f074ef38 100644 --- a/cli/scripts/install.sh +++ b/cli/scripts/install.sh @@ -60,6 +60,7 @@ function main() { echoInfo "Extracting..." echo "$ tar -xzf $pkg" tar -xzf "$pkg" + echo "$ ls -lh" ls -lh echo @@ -70,7 +71,7 @@ function main() { rm -rf "$(which hrp)" fi - echo "chmod +x hrp && mv hrp /usr/local/bin/" + echo "$ chmod +x hrp && mv hrp /usr/local/bin/" chmod +x hrp mv hrp /usr/local/bin/ echo From 21f4be59763233cb8621fc884c16ce8c4e2ba042 Mon Sep 17 00:00:00 2001 From: debugtalk Date: Thu, 20 Jan 2022 14:21:59 +0800 Subject: [PATCH 3/3] fix: mktemp: too few X's in template --- cli/scripts/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/scripts/install.sh b/cli/scripts/install.sh index f074ef38..f404b4fa 100644 --- a/cli/scripts/install.sh +++ b/cli/scripts/install.sh @@ -46,8 +46,8 @@ function main() { echo echoInfo "Created temp dir..." - echo "$ mktemp -d -t hrp" - tmp_dir=$(mktemp -d -t hrp) + echo "$ mktemp -d -t hrp.XXXX" + tmp_dir=$(mktemp -d -t hrp.XXXX) echo "$tmp_dir" cd "$tmp_dir" echo