CONFIG: use project api instead of version when finding config files

This commit is contained in:
Mark Olesen
2018-12-10 14:04:01 +01:00
parent ba7b032687
commit a38b459ab0
4 changed files with 48 additions and 47 deletions

View File

@ -16,6 +16,9 @@
# Description
# Quickly test the tutorials and write out the scheme/solver information
#
# Environment
# The entire OpenFOAM environment (WM_PROJECT_DIR, etc)
#
#------------------------------------------------------------------------------
cd ${0%/*} || exit 1 # Run from this directory
@ -128,24 +131,18 @@ EOF
#
# Location of the main controlDict
# Location of the user or project controlDict
#
unset MAIN_CONTROL_DICT
for i in \
$HOME/.$WM_PROJECT/$WM_PROJECT_VERSION \
$HOME/.$WM_PROJECT \
$WM_PROJECT_DIR/etc \
;
do
if [ -f "$i/controlDict" ]
if MAIN_CONTROL_DICT="$($WM_PROJECT_DIR/bin/foamEtcFile -mode=uo controlDict)"
then
if [ -e "${MAIN_CONTROL_DICT}.orig" ]
then
MAIN_CONTROL_DICT="$i/controlDict"
break
die "File ${MAIN_CONTROL_DICT}.orig already exists" \
"Did Alltest fail in some way and then run again?"
fi
done
[ -f "$MAIN_CONTROL_DICT" ] || usage "Main controlDict not found"
else
die "No main (user or project) controlDict found"
fi
TUTORIALS_DIR=$ROOT
@ -182,13 +179,6 @@ then
rm -rf $buildDir
fi
if [ -e ${MAIN_CONTROL_DICT}.orig ]
then
die "File ${MAIN_CONTROL_DICT}.orig already exists" \
"Did Alltest fail in some way and then run again?"
fi
unset gitbase
if [ -n "$useGit" ]