View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002490 | OpenFOAM | Patch | public | 2017-03-09 02:02 | 2019-07-16 14:42 |
Reporter | zhou13 | Assigned To | henry | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | GNU/Linux | OS | Other | OS Version | (please specify) |
Fixed in Version | dev | ||||
Summary | 0002490: make etc/bashrc zsh friendly | ||||
Description | In zsh, variable $BASH_SOURCE does not exist. This patch fixes this problem by falling back to $0 if BASH_SOURCE does not exist. diff --git a/etc/bashrc b/etc/bashrc index 0e88166e7..87e5606f2 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -42,8 +42,8 @@ export WM_PROJECT_VERSION=dev # # Please set to the appropriate path if the default is not correct. # -[ $BASH_SOURCE ] && \ -export FOAM_INST_DIR=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P) || \ +[ ${BASH_SOURCE:-$0} ] && \ +export FOAM_INST_DIR=$(cd $(dirname ${BASH_SOURCE:-$0})/../.. && pwd -P) || \ export FOAM_INST_DIR=$HOME/$WM_PROJECT # export FOAM_INST_DIR=~$WM_PROJECT # export FOAM_INST_DIR=/opt/$WM_PROJECT | ||||
Tags | No tags attached. | ||||
|
openfoam-zsh.patch (550 bytes)
diff --git a/etc/bashrc b/etc/bashrc index 0e88166e7..87e5606f2 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -42,8 +42,8 @@ export WM_PROJECT_VERSION=dev # # Please set to the appropriate path if the default is not correct. # -[ $BASH_SOURCE ] && \ -export FOAM_INST_DIR=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P) || \ +[ ${BASH_SOURCE:-$0} ] && \ +export FOAM_INST_DIR=$(cd $(dirname ${BASH_SOURCE:-$0})/../.. && pwd -P) || \ export FOAM_INST_DIR=$HOME/$WM_PROJECT # export FOAM_INST_DIR=~$WM_PROJECT # export FOAM_INST_DIR=/opt/$WM_PROJECT |
|
Resolved by commit 047460b0532160794a5cdfa54ba75766485b3a4f |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-03-09 02:02 | zhou13 | New Issue | |
2017-03-09 02:02 | zhou13 | File Added: openfoam-zsh.patch | |
2017-03-13 19:49 | henry | Assigned To | => henry |
2017-03-13 19:49 | henry | Status | new => resolved |
2017-03-13 19:49 | henry | Resolution | open => fixed |
2017-03-13 19:49 | henry | Fixed in Version | => dev |
2017-03-13 19:49 | henry | Note Added: 0007925 | |
2019-07-16 14:42 | henry | Relationship added | related to 0003303 |