# Install Go.
- go_version="go1.20.2.linux-arm64.tar.gz"
+ OS_ARCH=$(uname -m) || die "Failed to get arch."
+ case "${OS_ARCH}" in
+ x86_64) architecture="amd64" ;;
+ aarch64) architecture="arm64" ;;
+ esac
+
+ go_version="go1.20.2.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-arm64.tar.gz"
- rm "go1.20.2.linux-arm64.tar.gz"
+ tar -C "/usr/local" -xzf "go1.20.2.linux-${architecture}.tar.gz"
+ rm "go1.20.2.linux-${architecture}.tar.gz"
export PATH=$PATH:/usr/local/go/bin
}
# - die - Print to stderr and exit.
if ! installed hugo; then
- #die "Please install Hugo!"
- go_install || die "Failed to install Go!"
- hugo_install || die "Failed to install Hugo!"
- terraform_install || die "Failed to install Terraform!"
+ die "Please install Hugo!"
fi
+ hugo_book_url="github.com/alex-shpak/hugo-book"
+ hugo_book_version="v0.0.0-20230424134111-d86d5e70c7c0"
+ hugo_book_link="${hugo_book_url}@${hugo_book_version}"
pushd "${CSIT_DIR}"/docs || die "Pushd failed!"
- hugo mod get -u || die "Failed to run Hugo mod!"
+ export PATH=$PATH:/usr/local/go/bin
+ hugo mod get "${hugo_book_link}" || die "Failed to run Hugo mod!"
popd || die "Popd failed!"
}
# Install Hugo Extended.
- hugo_version="v0.111.3/hugo_extended_0.111.3_linux-arm64.deb"
+ OS_ARCH=$(uname -m) || die "Failed to get arch."
+ case "${OS_ARCH}" in
+ x86_64) architecture="amd64" ;;
+ aarch64) architecture="arm64" ;;
+ esac
+
+ hugo_version="v0.111.3/hugo_extended_0.111.3_linux-${architecture}.deb"
hugo_url="https://github.com/gohugoio/hugo/releases/download"
hugo_link="${hugo_url}/${hugo_version}"
wget -O "hugo.deb" "${hugo_link}" || die "Failed to install Hugo!"