STYLE: unify cd, check for the cwd and error message

This commit is contained in:
Mark Olesen
2017-02-06 09:13:59 +01:00
parent aaeab42691
commit 3e5307111c
4 changed files with 39 additions and 43 deletions

View File

@ -1,10 +1,9 @@
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
[ -d "$WM_PROJECT_DIR" ] || {
echo " Error: WM_PROJECT_DIR directory does not exist"
echo " Check the OpenFOAM entries in your dot-files and source them."
echo " WM_PROJECT_DIR=$WM_PROJECT_DIR"
echo "Error (${0##*/}) : no \$WM_PROJECT_DIR found"
echo " Check your OpenFOAM environment and installation"
echo " WM_PROJECT_DIR=$WM_PROJECT_DIR"
exit 1
}