mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: robustness, consistency for wmake -show-api, -version
- add to wmakeFunctions to ensure it works even without 'make' being
installed. Exit immediately after -show-api for consistency with
-version.
foamEtcFile:
- drop warnings for some old (pre-v1812) defunct options
and simply flag as unknown options.
- handle -version, --version as equivalent to -show-api
This commit is contained in:
@ -55,6 +55,28 @@ checkEnv()
|
||||
}
|
||||
|
||||
|
||||
# (api) from WM_DIR/rules/General/general
|
||||
# - extract WM_VERSION = OPENFOAM=<digits>
|
||||
getApiOpenFOAM()
|
||||
{
|
||||
local rulesFile="$WM_DIR/rules/General/general"
|
||||
local value
|
||||
|
||||
if [ -n "$WM_DIR" ] && [ -f "$rulesFile" ]
|
||||
then
|
||||
value="$(sed -ne 's@^ *WM_VERSION *= *OPENFOAM=\([0-9][0-9]*\).*@\1@p' "$rulesFile" 2>/dev/null)"
|
||||
fi
|
||||
|
||||
if [ -n "$value" ]
|
||||
then
|
||||
echo "$value"
|
||||
else
|
||||
echo "Could not extract OpenFOAM API value" 1>&2
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Set FOAM_MODULE_PREFIX according to
|
||||
# - absolute/relative path
|
||||
# - predefined type (u,user | g,group | o,openfoam)
|
||||
|
||||
Reference in New Issue
Block a user