X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=hugo%2Finstall.sh;h=1ef628415715a02e35a7715a8264e955c66f8420;hb=91512157ab426c87e0a82b594620e90e324b23a3;hp=04bc4f772e147a943905562f4357ca3fa7425e3c;hpb=66f0e8daa6ffbf4d8522de90b14ad5dc4b6fdcfd;p=webi-installers%2F.git diff --git a/hugo/install.sh b/hugo/install.sh index 04bc4f7..1ef6284 100644 --- a/hugo/install.sh +++ b/hugo/install.sh @@ -1,13 +1,14 @@ +#!/bin/bash set -e set -u pkg_cmd_name="hugo" WEBI_SINGLE=true -pkg_get_current_version() { +function pkg_get_current_version() { # 'hugo version' has output in this format: # Hugo Static Site Generator v0.72.0-8A7EF3CF darwin/amd64 BuildDate: 2020-05-31T12:07:44Z # This trims it down to just the version number: # 0.72.0 - echo "$(hugo version 2>/dev/null | head -n 1 | cut -d' ' -f5 | cut -d '-' -f1 | sed 's:^v::')" + echo "$(hugo version 2> /dev/null | head -n 1 | cut -d' ' -f5 | cut -d '-' -f1 | sed 's:^v::')" }