Skip to content
Snippets Groups Projects
Commit da878535 authored by Andre Maroneze's avatar Andre Maroneze
Browse files

[Eva] ensure gen-api.sh compatibility with Bash <4 (macsOS)

parent bdc1fa5e
No related branches found
No related tags found
No related merge requests found
...@@ -51,7 +51,8 @@ do ...@@ -51,7 +51,8 @@ do
if [[ ! "$i" =~ [.]in$ ]]; then if [[ ! "$i" =~ [.]in$ ]]; then
file=$(basename $i) file=$(basename $i)
module=${file%.*} 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 awk '/\[@@@ api_start\]/{flag=1;next} /\[@@@ api_end\]/{flag=0} flag{ print (NF ? " ":"") $0 }' $i >> Eva.mli
printf 'end\n' >> Eva.mli printf 'end\n' >> Eva.mli
fi fi
...@@ -66,6 +67,7 @@ do ...@@ -66,6 +67,7 @@ do
if [[ ! "$i" =~ [.]in$ ]]; then if [[ ! "$i" =~ [.]in$ ]]; then
file=$(basename $i) file=$(basename $i)
module=${file%.*} 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 fi
done done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment