aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorpmikus <peter.mikus@protonmail.ch>2024-08-23 09:49:41 +0200
committerpmikus <peter.mikus@protonmail.ch>2024-08-23 10:00:56 +0200
commit7dc3b9db651e4a0d9af348d509f7c8b5e398a4de (patch)
tree868d6f84b7ca75d04c9fd1f1ef83c919a52c6316 /resources
parent18c1cf1e62f3559576317d223213ece9a89f7546 (diff)
fix(bootstrap): Hugo init with go install
Signed-off-by: Peter Mikus <peter.mikus@protonmail.ch> Change-Id: Iadd4851ab4a7fc366ddffbace6ce7b47776fceeb
Diffstat (limited to 'resources')
-rw-r--r--resources/libraries/bash/function/hugo.sh14
1 files changed, 11 insertions, 3 deletions
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