From da87853568a3322da41f287ecd64885de9638172 Mon Sep 17 00:00:00 2001
From: Andre Maroneze <andre.maroneze@cea.fr>
Date: Thu, 7 Jul 2022 10:29:28 +0200
Subject: [PATCH] [Eva] ensure gen-api.sh compatibility with Bash <4 (macsOS)

---
 src/plugins/value/gen-api.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/plugins/value/gen-api.sh b/src/plugins/value/gen-api.sh
index 2db172e0d9f..dea87c497c5 100755
--- a/src/plugins/value/gen-api.sh
+++ b/src/plugins/value/gen-api.sh
@@ -51,7 +51,8 @@ do
     if [[ ! "$i" =~ [.]in$ ]]; then
         file=$(basename $i)
         module=${file%.*}
-        printf '\nmodule %s: sig\n' ${module^}  >> Eva.mli
+        Module="$(echo "${module:0:1}" | tr '[:lower:]' '[:upper:]')${module:1}"
+        printf '\nmodule %s: sig\n' $Module >> Eva.mli
         awk '/\[@@@ api_start\]/{flag=1;next} /\[@@@ api_end\]/{flag=0} flag{ print (NF ? "  ":"") $0 }' $i  >> Eva.mli
         printf 'end\n' >> Eva.mli
     fi
@@ -66,6 +67,7 @@ do
     if [[ ! "$i" =~ [.]in$ ]]; then
         file=$(basename $i)
         module=${file%.*}
-        printf '\nmodule %s = %s\n' ${module^} ${module^} >> Eva.ml
+        Module="$(echo "${module:0:1}" | tr '[:lower:]' '[:upper:]')${module:1}"
+        printf '\nmodule %s = %s\n' $Module $Module >> Eva.ml
     fi
 done
-- 
GitLab