From d7738fb2808dd32a735fef53ed43272dc8d9cb20 Mon Sep 17 00:00:00 2001 From: surtur Date: Mon, 6 Apr 2020 05:15:52 +0200 Subject: [PATCH] added gethugo little script --- bin/gethugo | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 bin/gethugo diff --git a/bin/gethugo b/bin/gethugo new file mode 100755 index 0000000..09d0c82 --- /dev/null +++ b/bin/gethugo @@ -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"