openFOAM-RANS-to-GPU/scripts/guard_gpu_rans_solver_when_done.sh

18 lines
502 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
NOTES_FILE="${ROOT_DIR}/.loop/notes.md"
STATUS_LINE=""
if [[ -f "${NOTES_FILE}" ]]; then
IFS= read -r STATUS_LINE < "${NOTES_FILE}" || STATUS_LINE=""
fi
if [[ "${STATUS_LINE}" != "STATUS: DONE" ]]; then
printf 'Skipping full GPU RANS guard because .loop/notes.md is not STATUS: DONE (%s)\n' "${STATUS_LINE:-missing}"
exit 0
fi
exec "${ROOT_DIR}/scripts/verify_gpu_rans_solver.sh" "$@"