Allwmake and {applications,src}/Allwmake use wmake/wmakeCheckPwd
- solves problems that can occur when checking $PWD and links are involved
This commit is contained in:
parent
1d8294b5b0
commit
bdbdd25bac
5
Allwmake
5
Allwmake
@ -1,13 +1,12 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
if [ "$PWD" != "$WM_PROJECT_DIR" ]
|
||||
then
|
||||
wmakeCheckPwd "$WM_PROJECT_DIR" || {
|
||||
echo "Error: Current directory is not \$WM_PROJECT_DIR"
|
||||
echo " The environment variables are inconsistent with the installation."
|
||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# wmake is required for subsequent targets
|
||||
( cd wmake/src && make )
|
||||
|
@ -1,13 +1,12 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
if [ "$PWD" != "$WM_PROJECT_DIR/applications" ]
|
||||
then
|
||||
wmakeCheckPwd "$WM_PROJECT_DIR/applications" || {
|
||||
echo "Error: Current directory is not \$WM_PROJECT_DIR/applications"
|
||||
echo " The environment variables are inconsistent with the installation."
|
||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
set -x
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
|
||||
if [ "$PWD" != "$WM_PROJECT_DIR/src" ]
|
||||
then
|
||||
wmakeCheckPwd "$WM_PROJECT_DIR/src" || {
|
||||
echo "Error: Current directory is not \$WM_PROJECT_DIR/src"
|
||||
echo " The environment variables are inconsistent with the installation."
|
||||
echo " Check the OpenFOAM entries in your dot-files and source them."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
set -x
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
#
|
||||
# Script
|
||||
# foamCheckPwd
|
||||
# wmakeCheckPwd
|
||||
#
|
||||
# Description
|
||||
# Check that the current working directory is equal to a particular
|
||||
@ -80,19 +80,24 @@ done
|
||||
dirName="$1"
|
||||
|
||||
|
||||
# trival checks first
|
||||
# trivial checks first
|
||||
[ "$PWD" = "$dirName" ] && exit 0
|
||||
[ -d "$dirName" ] || exit 1
|
||||
|
||||
[ -d "$dirName" ] || {
|
||||
[ "$quietOpt" = true ] || echo "Error: Directory does not exist $dirName"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
# use /bin/pwd to get the absolute path (could be linked)
|
||||
thisDir=$(/bin/pwd)
|
||||
dirName=$(cd $dirName 2>/dev/null && /bin/pwd)
|
||||
target=$(cd $dirName 2>/dev/null && /bin/pwd)
|
||||
|
||||
# okay
|
||||
[ "$thisDir" = "$dirName" ] && exit 0
|
||||
[ "$thisDir" = "$target" ] && exit 0
|
||||
|
||||
# some other error
|
||||
[ "$quietOpt" = true ] || echo "Error: Current directory is not $dirName"
|
||||
exit 1
|
||||
|
||||
#------------------------------------------------------------------------------
|
Loading…
Reference in New Issue
Block a user