STYLE: regularize quoting and exit on failed 'cd'

This commit is contained in:
Mark Olesen
2019-11-13 12:46:30 +01:00
parent e51f92f2f1
commit c8a7f46db2
31 changed files with 235 additions and 147 deletions

View File

@ -3,10 +3,11 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#------------------------------------------------------------------------------
# | Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2016-2019 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, licensed under GNU General Public License
@ -27,7 +28,8 @@
# NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
#------------------------------------------------------------------------------
# Run from third-party directory only
cd ${0%/*} && wmakeCheckPwd "$WM_THIRD_PARTY_DIR" 2>/dev/null || {
cd "${0%/*}" || exit
wmakeCheckPwd "$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