From 7dc3b9db651e4a0d9af348d509f7c8b5e398a4de Mon Sep 17 00:00:00 2001 From: pmikus Date: Fri, 23 Aug 2024 09:49:41 +0200 Subject: fix(bootstrap): Hugo init with go install Signed-off-by: Peter Mikus Change-Id: Iadd4851ab4a7fc366ddffbace6ce7b47776fceeb --- resources/libraries/bash/function/hugo.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'resources/libraries/bash/function/hugo.sh') diff --git a/resources/libraries/bash/function/hugo.sh b/resources/libraries/bash/function/hugo.sh index ba5591b72e..6c201d9efd 100644 --- a/resources/libraries/bash/function/hugo.sh +++ b/resources/libraries/bash/function/hugo.sh @@ -26,12 +26,12 @@ function go_install () { aarch64) architecture="arm64" ;; esac - go_version="go1.20.2.linux-${architecture}.tar.gz" + go_version="go1.22.5.linux-${architecture}.tar.gz" go_url="https://go.dev/dl" wget "${go_url}/${go_version}" rm -rf "/usr/local/go" - tar -C "/usr/local" -xzf "go1.20.2.linux-${architecture}.tar.gz" - rm "go1.20.2.linux-${architecture}.tar.gz" + tar -C "/usr/local" -xzf "go1.22.5.linux-${architecture}.tar.gz" + rm "go1.22.5.linux-${architecture}.tar.gz" export PATH=$PATH:/usr/local/go/bin } @@ -45,6 +45,10 @@ function hugo_build_site () { # Functions called: # - die - Print to stderr and exit. + if ! install go; then + go_install || die "Please install Go!" + fi + if ! installed hugo; then hugo_install || die "Please install Hugo!" fi @@ -64,6 +68,10 @@ function hugo_init_modules () { # Functions called: # - die - Print to stderr and exit. + if ! install go; then + go_install || die "Please install Go!" + fi + if ! installed hugo; then hugo_install || die "Please install Hugo!" fi -- cgit 1.2.3-korg