mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-03 15:40:32 +00:00
Composer plugin
- add function "composer" - uses local composer if available - add function "composer_install" to install composer to current dir
This commit is contained in:
parent
c56d016f7d
commit
d3daa585aa
10
plugins/composer/composer.fish
Normal file
10
plugins/composer/composer.fish
Normal file
@ -0,0 +1,10 @@
|
||||
# composer command
|
||||
function composer
|
||||
if test -e ./composer.phar # if there is composer in this path use local one
|
||||
./composer.phar $argv;
|
||||
else if test -n "$COMPOSER_BIN"
|
||||
eval "$COMPOSER_BIN" $argv;
|
||||
else
|
||||
echo "Please install composer.phar to your PATH. Or use \"composer_install\" to install Composer to current directory."
|
||||
end
|
||||
end
|
16
plugins/composer/composer.load
Normal file
16
plugins/composer/composer.load
Normal file
@ -0,0 +1,16 @@
|
||||
# add Composer's global binaries to PATH
|
||||
if test -z "$COMPOSER_BIN_PATH"
|
||||
set -gx COMPOSER_BIN_PATH $HOME/.composer/vendor/bin
|
||||
end
|
||||
set PATH $COMPOSER_BIN_PATH $PATH
|
||||
|
||||
# get composer path
|
||||
if test -z "$COMPOSER_BIN"
|
||||
if type "composer.phar" > /dev/null
|
||||
set -gx COMPOSER_BIN (which composer.phar)
|
||||
else if type "composer" > /dev/null
|
||||
set -gx COMPOSER_BIN (which composer)
|
||||
else
|
||||
echo "FAILED to find Composer! Please install composer.phar to your PATH."
|
||||
end
|
||||
end
|
4
plugins/composer/composer_install.fish
Normal file
4
plugins/composer/composer_install.fish
Normal file
@ -0,0 +1,4 @@
|
||||
# install composer in the current directory
|
||||
function composer_install
|
||||
curl -s https://getcomposer.org/installer | php
|
||||
end
|
Loading…
Reference in New Issue
Block a user