File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 1313VFILE=" .hugoversion"
1414VERSION=$( cat $VFILE )
1515
16- echo " Searching for Hugo $VERSION "
17-
18- URL=` curl -s https://api.github.com/repos/gohugoio/hugo/releases \
19- | jq -r --arg version $VERSION \
20- ' [.[]
21- | select(.tag_name == $version)
22- | .assets[]
23- | select(.browser_download_url | test("hugo_extended(.*)Linux-64bit"))][0]
24- | .browser_download_url' `
16+ TAG_URL=" https://api.github.com/repos/gohugoio/hugo/releases/tags/$VERSION "
17+ echo " Searching for Hugo $VERSION at $TAG_URL "
18+
19+ URL=$( curl -s " $TAG_URL " |
20+ jq -r ' [.assets[] | select(.browser_download_url | test("hugo_extended.*Linux-64bit"))][0] | .browser_download_url' )
21+
22+ if [[ -z " $URL " || " $URL " == " null" ]]; then
23+ echo " Could not find a suitable Hugo binary for $VERSION ."
24+ exit 1
25+ fi
2526
2627echo " Found $URL "
2728
You can’t perform that action at this time.
0 commit comments