feat(ebs): Install hugo if not found 51/41351/2 oper-240805
authorpmikus <[email protected]>
Thu, 1 Aug 2024 11:15:13 +0000 (13:15 +0200)
committerPeter Mikus <[email protected]>
Thu, 1 Aug 2024 11:34:49 +0000 (11:34 +0000)
Signed-off-by: Peter Mikus <[email protected]>
Change-Id: Ice4c09579a174c0ce3d26c8429016d55414bfb93

resources/libraries/bash/function/hugo.sh

index 052e833..52a6d0a 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 
-# Copyright (c) 2023 Cisco and/or its affiliates.
+# Copyright (c) 2024 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -46,7 +46,7 @@ function hugo_build_site () {
     # - die - Print to stderr and exit.
 
     if ! installed hugo; then
-        die "Please install Hugo!"
+        hugo_install || die "Please install Hugo!"
     fi
 
     pushd "${CSIT_DIR}"/docs || die "Pushd failed!"
@@ -65,7 +65,7 @@ function hugo_init_modules () {
     # - die - Print to stderr and exit.
 
     if ! installed hugo; then
-        die "Please install Hugo!"
+        hugo_install || die "Please install Hugo!"
     fi
 
     hugo_book_url="github.com/alex-shpak/hugo-book"