quick fix error -1

This commit is contained in:
pvincent
2024-03-06 21:57:53 +04:00
parent eb1c3be73a
commit 0483644f7f
2 changed files with 7 additions and 9 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ function usage {
echo -e '\t# With destination' echo -e '\t# With destination'
echo -e "\t$BASECMD artcode libre/libre-gnome /tmp # folder" echo -e "\t$BASECMD artcode libre/libre-gnome /tmp # folder"
echo -e "\t$BASECMD artcode libre/libre-gnome /tmp/release.tgz # file" echo -e "\t$BASECMD artcode libre/libre-gnome /tmp/release.tgz # file"
exit -1 exit 1
} }
function get_github { function get_github {
+6 -8
View File
@@ -4,14 +4,15 @@ REPO_TYPE=$1
REPO_NAME=$2 REPO_NAME=$2
function usage { function usage {
local BASECMD=$(basename "$0") local basecmd
basecmd=$(basename "$0")
echo 'usage: <REPO_TYPE> <REPO_NAME> [DESTINATION]' echo 'usage: <REPO_TYPE> <REPO_NAME> [DESTINATION]'
echo 'example:' echo 'example:'
echo -e '\t# REPO_TYPE=github' 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# REPO_TYPE=artcode'
echo -e "\t$BASECMD artcode libre/libre-gnome\n" echo -e "\t${basecmd} artcode libre/libre-gnome\n"
exit -1 exit 1
} }
function get_github { function get_github {
@@ -34,10 +35,7 @@ function get_github {
} }
function get_artcode { function get_artcode {
release=$(git ls-remote --tags --sort="v:refname" \ git ls-remote --tags --sort="v:refname" "https://git.artcode.re/$REPO_NAME" | tail -n1 | cut -f2 | cut -d '/' -f3
https://git.artcode.re/$REPO_NAME |
tail -n1 | cut -f2 | cut -d '/' -f3)
echo $release
} }
[[ $# -ne 2 ]] && usage [[ $# -ne 2 ]] && usage