From 82eeadd1eaa65a6f97ed8ffcc0e3d391ec4b89fc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Oriol=20Tint=C3=B3?= <oriol.tinto@lmu.de>
Date: Thu, 23 Mar 2023 16:34:41 +0100
Subject: [PATCH] Fix build_icon.sh again.

---
 templates/common/build_icon.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/templates/common/build_icon.sh b/templates/common/build_icon.sh
index 433ea71..6c4e764 100644
--- a/templates/common/build_icon.sh
+++ b/templates/common/build_icon.sh
@@ -19,7 +19,9 @@ if [ ! -z "$SPACK_BUILD_ICON" ]; then
   echo "Installing ICON with spack!"
   echo "cmd=$SPACK_BUILD_ICON"
   # In case the autosubmit repository with the icon-nwp receipt doesn't exist, add it
-  if [ $(spack repo list | grep autosubmit-icon-repository -q) ]; then
+  if [[ $(spack repo list | grep "${WORKDIR}/proj/spack_repo") ]]; then
+    echo "icon spack repo was already added to repo list"
+  else
     spack repo add ${WORKDIR}/proj/spack_repo
   fi
   spack install $SPACK_BUILD_ICON
-- 
GitLab