From 12d8b7deb21da019675c3072d2a41f753f0dab88 Mon Sep 17 00:00:00 2001
From: "Fabian.Jakub" <fabian@jakub.com>
Date: Tue, 13 Jun 2023 18:14:13 +0200
Subject: [PATCH] in case we dont have git in path to clone spack, try to load
 it from the module system

---
 platforms/common/spack_utils.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/platforms/common/spack_utils.sh b/platforms/common/spack_utils.sh
index 0c5e4eb..fd32c0d 100644
--- a/platforms/common/spack_utils.sh
+++ b/platforms/common/spack_utils.sh
@@ -1,5 +1,11 @@
 function _install_spack() {
   if [ ! -e ${SPACK_ROOT} ]; then
+    if ! command -v git &> /dev/null
+    then
+      echo "git could not be found ... will try to load it form the module system ..."
+      module load git || echo "could not load git from module system"
+    fi
+
     echo "Cloning to ${SPACK_ROOT}"
     git clone --depth 1 ${SPACK_URL} -b ${SPACK_BRANCH} ${SPACK_ROOT}
   fi
-- 
GitLab