diff --git a/DownloadLast.sh b/DownloadLast.sh index 620e0c2..c449b0a 100755 --- a/DownloadLast.sh +++ b/DownloadLast.sh @@ -3,17 +3,17 @@ echo "Branch: "$1 if [[ $1 = "master" ]] then - base_url="https://jenkins.seb6596.ovh/job/Bot%20Discord%20Gradle/lastStableBuild/artifact/" + base_url="https://jenkins.seb6596.ovh/job/Bot%20Discord%20Gradle/lastStableBuild" else - base_url="https://jenkins.seb6596.ovh/job/Bot%20Discord%20Gradle%20Devel/lastStableBuild/artifact/" + base_url="https://jenkins.seb6596.ovh/job/Bot%20Discord%20Gradle%20Devel/lastStableBuild/" fi -data=$(curl -s -g "https://jenkins.seb6596.ovh/job/Bot%20Discord%20Gradle/lastStableBuild/api/xml?xpath=/freeStyleBuild/artifact&wrapper=artifacts") +data=$(curl -s -g ${base_url}"/api/xml?xpath=/freeStyleBuild/artifact&wrapper=artifacts") relativePath=$(grep -oPm1 "(?<=)[^<]+" <<< "$data") jarFile=$(grep -oPm1 "(?<=)[^<]+" <<< "$data") -wget ${base_url}${relativePath} -O bot.jar -q +wget ${base_url}"/artifact/"${relativePath} -O bot.jar -q