File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,12 +4,18 @@ HAS_NODE=`which node 2> /dev/null || which nodejs 2> /dev/null || which iojs 2>
44
55#
66# There are some issues with Source Tree because paths are not set correctly for
7- # the given environment. Sourcing the bash_profile seems to resolve this for users
7+ # the given environment. Sourcing the bash_profile seems to resolve this for bash users,
8+ # sourcing the zshrc for zshell users.
89#
910# https://answers.atlassian.com/questions/140339/sourcetree-hook-failing-because-paths-don-t-seem-to-be-set-correctly
1011#
11- if [ -z " $HAS_NODE " ] && [ -f ~ /.bash_profile ]; then
12- source ~ /.bash_profile
12+ function source_home_file {
13+ file=" $HOME /$1 "
14+ [[ -f " ${file} " ]] && source " ${file} "
15+ }
16+
17+ if [[ -z " $HAS_NODE " ]]; then
18+ source_home_file " .bash_profile" || source_home_file " .zshrc" || true
1319fi
1420
1521NODE=` which node 2> /dev/null`
You can’t perform that action at this time.
0 commit comments