From 1a166debc2673f703a5ba9a1fa3ab92b499b9594 Mon Sep 17 00:00:00 2001 From: "clara.bayley" Date: Thu, 11 Apr 2024 22:47:17 +0200 Subject: [PATCH] feat(bash): if statement on bash inputs --- src/build_compile_cleocoupledsdm.sh | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/build_compile_cleocoupledsdm.sh b/src/build_compile_cleocoupledsdm.sh index 2fc8a1c98..36b006877 100755 --- a/src/build_compile_cleocoupledsdm.sh +++ b/src/build_compile_cleocoupledsdm.sh @@ -28,16 +28,22 @@ then fi ### ---------------------------------------------------- ### -### ----------------- build executable --------------- ### -buildcmd="${path2CLEO}/scripts/bash/build_cleo.sh ${buildtype} ${path2CLEO} ${path2build}" -echo ${buildcmd} -${buildcmd} -### ---------------------------------------------------- ### +if [[ "${buildtype}" != "" && "${path2CLEO}" != "" && "${path2build}" != "" && + "${executable}" != "" && "${path2CLEO}" != "${path2build}" ]] +then + ### ----------------- build executable --------------- ### + buildcmd="${path2CLEO}/scripts/bash/build_cleo.sh ${buildtype} ${path2CLEO} ${path2build}" + echo ${buildcmd} + ${buildcmd} + ### ---------------------------------------------------- ### -### ----------------- compile executable --------------- ### -cd ${path2build} && make clean + ### ----------------- compile executable --------------- ### + cd ${path2build} && make clean -compilecmd="${path2CLEO}/scripts/bash/compile_cleo.sh ${path2build} ${executable}" -echo ${compilecmd} -${compilecmd} -### ---------------------------------------------------- ### + compilecmd="${path2CLEO}/scripts/bash/compile_cleo.sh ${path2build} ${executable}" + echo ${compilecmd} + ${compilecmd} + ### ---------------------------------------------------- ### +else + echo "Bad inputs, please check your buildtype, path2CLEO, path2build and executable names" +fi