From 0483644f7f2c52de1c01d73c7cdda7ae3f5361a8 Mon Sep 17 00:00:00 2001 From: pvincent Date: Wed, 6 Mar 2024 21:57:53 +0400 Subject: [PATCH] quick fix error -1 --- tools/wget_release | 2 +- tools/wget_semver | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/wget_release b/tools/wget_release index 51a02e0..919c37f 100755 --- a/tools/wget_release +++ b/tools/wget_release @@ -15,7 +15,7 @@ function usage { echo -e '\t# With destination' echo -e "\t$BASECMD artcode libre/libre-gnome /tmp # folder" echo -e "\t$BASECMD artcode libre/libre-gnome /tmp/release.tgz # file" - exit -1 + exit 1 } function get_github { diff --git a/tools/wget_semver b/tools/wget_semver index 2f2aa09..aecc41b 100755 --- a/tools/wget_semver +++ b/tools/wget_semver @@ -4,14 +4,15 @@ REPO_TYPE=$1 REPO_NAME=$2 function usage { - local BASECMD=$(basename "$0") + local basecmd + basecmd=$(basename "$0") echo 'usage: [DESTINATION]' echo 'example:' echo -e '\t# REPO_TYPE=github' - echo -e "\t$BASECMD github Dolibarr/dolibarr\n" + echo -e "\t${basecmd} github Dolibarr/dolibarr\n" echo -e '\t# REPO_TYPE=artcode' - echo -e "\t$BASECMD artcode libre/libre-gnome\n" - exit -1 + echo -e "\t${basecmd} artcode libre/libre-gnome\n" + exit 1 } function get_github { @@ -34,10 +35,7 @@ function get_github { } function get_artcode { - release=$(git ls-remote --tags --sort="v:refname" \ - https://git.artcode.re/$REPO_NAME | - tail -n1 | cut -f2 | cut -d '/' -f3) - echo $release + git ls-remote --tags --sort="v:refname" "https://git.artcode.re/$REPO_NAME" | tail -n1 | cut -f2 | cut -d '/' -f3 } [[ $# -ne 2 ]] && usage