Now the script doesn't fail if sourced from cshrc but it can't detect its name and location (only tcsh)
--HG-- branch : bgschaid/minorAdditionsBranch
This commit is contained in:
parent
274117250a
commit
13b86450c8
1 changed files with 3 additions and 3 deletions
|
@ -36,7 +36,7 @@ unset WM_PROJECT_VERSION_ADDITION
|
|||
unsetenv WM_PROJECT_VERSION_ADDITION
|
||||
|
||||
set called=($_)
|
||||
if ( $#called != 1 ) then
|
||||
if ( $#called > 1 ) then
|
||||
# tcsh - csh doesn't know about the location
|
||||
set thisScript=$called[2]
|
||||
set prefSettingFile=$thisScript.preset
|
||||
|
@ -46,13 +46,13 @@ if ( $#called != 1 ) then
|
|||
source $prefSettingFile
|
||||
endif
|
||||
else
|
||||
echo "csh - WM_PROJECT_VERSION_ADDITION not supported"
|
||||
echo "csh or tcsh called from .cshrc - WM_PROJECT_VERSION_ADDITION not supported"
|
||||
endif
|
||||
|
||||
setenv WM_PROJECT OpenFOAM
|
||||
setenv WM_PROJECT_VERSION 1.6-ext
|
||||
|
||||
if ( $#called != 1 ) then
|
||||
if ( $#called > 1 ) then
|
||||
if( ! $?WM_PROJECT_VERSION_ADDITION ) then
|
||||
setenv WM_PROJECT_VERSION_ADDITION `python -c "from os.path import *;print abspath(join(curdir,'$thisScript')).split(sep)[-3][len('OpenFOAM-$WM_PROJECT_VERSION')+1:]"`
|
||||
if ( "$WM_PROJECT_VERSION_ADDITION" == "" ) then
|
||||
|
|
Reference in a new issue