added gethugo little script

This commit is contained in:
surtur 2020-04-06 05:15:52 +02:00
parent 12fb00ad87
commit d7738fb280
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

23
bin/gethugo Executable file

@ -0,0 +1,23 @@
#!/bin/bash
if [ -z $1 ]; then
echo "[x] HUGO_VERSION is not set, pass it as \$1"
exit 9001
else
HUGO_VERSION=$1
fi
mktemp -d && cd /tmp/$(ls -t /tmp | grep tmp. | head -1)
WORKDIR=$(pwd)
HOMEBIN="/home/$USER/.local/bin"
mkdir -pv $HOMEBIN
echo "[*] downloading hugo version \"$HUGO_VERSION\""
wget -qO- https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz | bsdtar xfv -
mv -vf hugo ${HOMEBIN}
cd ..
rm -rfv $WORKDIR
echo "[*] hugo updated to version $HUGO_VERSION"