bin/tools/RunFunctions: Added check to runApplication and runParallel

to issue an error message if the application argument is not provided.
This commit is contained in:
Henry Weller
2024-01-23 12:19:41 +00:00
parent 60acc3a845
commit 5e64111838

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -86,9 +86,15 @@ runApplication()
shift
done
if [ -z "$APP_RUN" ]
then
echo "Error: application not specified"
return 1
fi
if [ -f log.$LOG_SUFFIX ] && [ "$LOG_IGNORE" = "false" ]
then
echo "$APP_NAME already run on $PWD:" \
echo "$APP_RUN already run on $PWD:" \
"remove log file 'log.$LOG_SUFFIX' to re-run"
else
echo "Running $APP_RUN on $PWD"
@ -137,9 +143,15 @@ runParallel()
shift
done
if [ -z "$APP_RUN" ]
then
echo "Error: application not specified"
return 1
fi
if [ -f log.$LOG_SUFFIX ] && [ "$LOG_IGNORE" = "false" ]
then
echo "$APP_NAME already run on $PWD:" \
echo "$APP_RUN already run on $PWD:" \
"remove log file 'log.$LOG_SUFFIX' to re-run"
else
echo "Running $APP_RUN in parallel on $PWD using $nProcs processes"