STYLE: clearly document which scripts contain user-configurable settings

- unify cd, check for the cwd and error message
This commit is contained in:
mark
2017-01-19 20:47:15 +01:00
parent 9926569ca1
commit 1622a46832
17 changed files with 221 additions and 229 deletions

View File

@ -4,7 +4,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
@ -28,20 +28,20 @@
# Description
# Build script for cmake
#
#------------------------------------------------------------------------------
# Special purpose script, no default version.
unset cmakePACKAGE
# ----------------------------------------------
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
cd ${0%/*} && wmakeCheckPwd -q "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
echo "Error (${0##*/}) : not located in \$WM_THIRD_PARTY_DIR"
echo " Check your OpenFOAM environment and installation"
exit 1
}
. etc/tools/ThirdPartyFunctions
#------------------------------------------------------------------------------
# Special purpose script - no default version.
unset cmakePACKAGE
#------------------------------------------------------------------------------
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
@ -53,7 +53,7 @@ options:
-help
* build cmake
${cmakePACKAGE:-'unspecified version'}
${cmakePACKAGE:-'unspecified'}
USAGE
exit 1