Skip to content

Instantly share code, notes, and snippets.

@gopinath-langote
Created September 27, 2019 12:17
Show Gist options
  • Save gopinath-langote/d028366d4fa3c1d57b7d368bd7ec1e2a to your computer and use it in GitHub Desktop.
Save gopinath-langote/d028366d4fa3c1d57b7d368bd7ec1e2a to your computer and use it in GitHub Desktop.
#!/bin/bash
pushd /tmp/
curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest \
| grep "browser_download_url.*hugo_[^extended].*_Linux-64bit\.tar\.gz" \
| cut -d ":" -f 2,3 \
| tr -d \" \
| wget -qi -
tarball="$(find . -name "*Linux-64bit.tar.gz")"
tar -xzf $tarball
chmod +x hugo
mv hugo /usr/local/bin/
popd
location="$(which hugo)"
echo "Hugo binary location: $location"
version="$(hugo version)"
echo "Hugo binary version: $version"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment