Fix for Composer's bin when Composer isn't global
When Composer isn't globally installed, the `composer global` call results in an error. This checks to see if Composer is available before making the call. When Composer isn't available, it will just manually set the directories.
This commit is contained in:
parent
d848c94804
commit
14043e73a8
@ -51,5 +51,10 @@ alias cgrm='composer global remove'
|
||||
# install composer in the current directory
|
||||
alias cget='curl -s https://getcomposer.org/installer | php'
|
||||
|
||||
# Add Composer's global binaries to PATH
|
||||
# Add Composer's global binaries to PATH, using Composer if available.
|
||||
if hash composer 2>/dev/null; then
|
||||
export PATH=$PATH:$(composer global config bin-dir --absolute) 2>/dev/null
|
||||
else
|
||||
export PATH=$PATH:~/.composer/vendor/bin
|
||||
export PATH=$PATH:~/.config/composer/vendor/bin
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user