Created
November 9, 2018 16:32
-
-
Save misterorion/8824811c3e25bba3c05189e513f1a585 to your computer and use it in GitHub Desktop.
Bash script to upgrade Hugo to a given version
This file contains 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/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