Skip to content

Instantly share code, notes, and snippets.

@misterorion
Created November 9, 2018 16:32
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 misterorion/8824811c3e25bba3c05189e513f1a585 to your computer and use it in GitHub Desktop.
Save misterorion/8824811c3e25bba3c05189e513f1a585 to your computer and use it in GitHub Desktop.
Bash script to upgrade Hugo to a given version
#!/bin/bash
echo -e "Which release would you like to install? (e.g. 51): \c"
read version
file="hugo_0.${version}_Linux-64bit.tar.gz"
URL=https://github.com/gohugoio/hugo/releases/download/v0.$version/$file
target_dir="/home/$(whoami)/bin/"
echo Installing...
wget -qO- $URL | tar xz -C $target_dir hugo
echo Done!
echo Installed Hugo $(hugo version | awk '{ print $5 }')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment