Created
April 20, 2021 12:42
-
-
Save soulim/858bec85730adeccb04ad2e3b979f2dc to your computer and use it in GitHub Desktop.
Get the latest hugo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BIN_DIR="./bin" | |
TMP_DIR="./tmp" | |
wget --quiet \ | |
--no-verbose \ | |
--output-document=- \ | |
"https://api.github.com/repos/gohugoio/hugo/releases/latest" \ | |
| jq -r '.assets[].browser_download_url | select(test("hugo_[0-9]+.[0-9]+.[0-9]*_$(OS)-64bit.tar.gz"))' \ | |
| xargs wget --quiet \ | |
--no-verbose \ | |
--directory-prefix=$(TMP_DIR) \ | |
&& find $(TMP_DIR) -name "*_$(OS)-64bit.tar.gz" -exec tar --gzip \ | |
--extract \ | |
--directory $(BIN_DIR) \ | |
--file='{}' ./hugo \; \ | |
&& $(HUGO) version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment