From 7f3f3eed06180831a839a1e128ab70ac25dd5e65 Mon Sep 17 00:00:00 2001 From: DavidHuber Date: Tue, 31 Oct 2023 12:25:21 +0000 Subject: [PATCH] Clean the ww3prepost build dir; address shellcheck warnings #1978 --- sorc/build_all.sh | 8 ++++---- sorc/build_ww3prepost.sh | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sorc/build_all.sh b/sorc/build_all.sh index add3ad26c7..c68c548d79 100755 --- a/sorc/build_all.sh +++ b/sorc/build_all.sh @@ -194,21 +194,21 @@ declare -A build_ids builds_started=0 # Now start looping through all of the jobs until everything is done while [[ ${builds_started} -lt ${#build_jobs[@]} ]]; do - for build in ${!build_jobs[@]}; do + for build in "${!build_jobs[@]}"; do # Has the job started? if [[ -n "${build_jobs[${build}]+0}" && -z "${build_ids[${build}]+0}" ]]; then # Do we have enough processors to run it? if [[ ${_build_job_max} -ge $(( build_jobs[build] + procs_in_use )) ]]; then if [[ "${build}" != "upp" ]]; then - ./build_${build}.sh -j "${build_jobs[${build}]}" "${build_opts[${build}]}" > \ + "./build_${build}.sh" -j "${build_jobs[${build}]}" "${build_opts[${build}]}" > \ "${logs_dir}/build_${build}.log" 2>&1 & else - ./build_${build}.sh "${build_opts[${build}]}" > \ + "./build_${build}.sh" "${build_opts[${build}]}" > \ "${logs_dir}/build_${build}.log" 2>&1 & fi build_ids["${build}"]=$! echo "Starting build_${build}.sh" - procs_in_use=$(( procs_in_use + build_jobs['${build}'] )) + procs_in_use=$(( procs_in_use + build_jobs[${build}] )) fi fi done diff --git a/sorc/build_ww3prepost.sh b/sorc/build_ww3prepost.sh index ec090bd9b0..919afaacb3 100755 --- a/sorc/build_ww3prepost.sh +++ b/sorc/build_ww3prepost.sh @@ -59,6 +59,7 @@ post_exes="ww3_outp ww3_outf ww3_outp ww3_gint ww3_ounf ww3_ounp ww3_grib" #create build directory: path_build="${WW3_DIR}/build_SHRD" +[[ -d "${path_build}" ]] && rm -rf "${path_build}" mkdir -p "${path_build}" || exit 1 cd "${path_build}" || exit 1 echo "Forcing a SHRD build"