Florian du Garage Num 6db283eb13 first commit
2023-12-15 16:14:36 +01:00

26 lines
480 B
Bash

#!/bin/sh
BUILD_DIR=$1
HUGO_VERSION=$(grep 'hugoVersion' $BUILD_DIR/config.yaml | cut -d '"' -f 2)
if [ -z "$HUGO_VERSION" ]; then
HUGO_VERSION="0.111.2" # default version
fi
# Download and install Hugo
curl -s https://api.github.com/repos/gohugoio/hugo/releases/tags/v$HUGO_VERSION \
| grep browser_download_url \
| grep linux-amd64.deb \
| grep extended \
| cut -d '"' -f 4 \
| wget -i -
dpkg -i hugo*_linux-amd64.deb
rm hugo*_linux-amd64.deb
cd $BUILD_DIR
hugo