Skip to content

Instantly share code, notes, and snippets.

@soulim
Created April 20, 2021 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soulim/858bec85730adeccb04ad2e3b979f2dc to your computer and use it in GitHub Desktop.
Save soulim/858bec85730adeccb04ad2e3b979f2dc to your computer and use it in GitHub Desktop.
Get the latest hugo
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