mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
CONFIG: remove non-POSIX use of 'type' (issue #176)
- In the foundation version they introduced a construct to handle the transition from 'wmRefresh' as an alias to 'wmRefresh' as a shell function. This transition is unnecessary for OpenFOAM+ since 1606 used wmREFRESH (not wmRefresh) as an alias. For portability it is important to avoid this non-POSIX "type -t". It causes issues with dash and with zsh (mentioned in issue #277). type -t dash -> -t: not found type -t zsh -> zsh: bad option: -t Note: zsh users may still noticed other problems. For example, the POSIX 'unset -f' normally has no output, but in zsh it reports an error and has exit code 1 if the function was not previously defined. Whereas in POSIX (including bash, dash) it only returns non-zero if the name(s) could not be unset.
This commit is contained in:
@ -69,8 +69,7 @@ alias run='cd $FOAM_RUN'
|
||||
|
||||
# Refresh the environment
|
||||
# ~~~~~~~~~~~~~~~~~~~~~~~
|
||||
# For backward-compatibility unalias wmRefresh if it is defined as an alias
|
||||
[ "$(type -t wmRefresh)" = "alias" ] && unalias wmRefresh || unset -f wmRefresh
|
||||
unset -f wmRefresh
|
||||
wmRefresh()
|
||||
{
|
||||
wmProjectDir=$WM_PROJECT_DIR
|
||||
|
||||
Reference in New Issue
Block a user