summaryrefslogtreecommitdiff
path: root/download-latest.sh
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2023-01-13 23:24:39 +0100
committerValery Piashchynski <[email protected]>2023-01-13 23:24:39 +0100
commit2679600746eda8177bbea53abcf482e49be91c4c (patch)
treeb7ff89e73f90ac687cca9683a9918fd609a6d220 /download-latest.sh
parent66719ad1a0c9112af67d43ba5e2142357301f790 (diff)
fix unsupported sh substitution
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'download-latest.sh')
-rw-r--r--download-latest.sh7
1 files changed, 3 insertions, 4 deletions
diff --git a/download-latest.sh b/download-latest.sh
index 15e80333..eafb2eb6 100644
--- a/download-latest.sh
+++ b/download-latest.sh
@@ -12,7 +12,6 @@ DEFAULT='\033[0m'
# Project name
PNAME='roadrunner'
-v='v'
# GitHub API address
GITHUB_API='https://api.github.com/repos/roadrunner-server/roadrunner/releases'
@@ -40,8 +39,8 @@ get_latest() {
curl -H "Authorization: token $GITHUB_PAT" -s "$latest_release" >"$temp_file" || return 1
fi
- latest="$(cat "$temp_file" | grep '"tag_name":' | cut -d ':' -f2 | tr -d '"' | tr -d ',' | tr -d ' ')"
- latest="${latest:1}"
+ latest="$(cat "$temp_file" | grep '"tag_name":' | cut -d ':' -f2 | tr -d '"' | tr -d ',' | tr -d ' ' | tr -d 'v')"
+ latestV="$(cat "$temp_file" | grep '"tag_name":' | cut -d ':' -f2 | tr -d '"' | tr -d ',' | tr -d ' ')"
rm -f "$temp_file"
return 0
@@ -176,7 +175,7 @@ download_binary() {
echo "Downloading RoadRunner binary $latest for $os, architecture $archi..."
release_file="$PNAME-$latest-$os-$archi.$compress"
- curl --fail -OL "$GITHUB_REL/${v}$latest/$release_file"
+ curl --fail -OL "$GITHUB_REL/$latestV/$release_file"
if [ $? -ne 0 ]; then
fetch_release_failure_usage
exit 1