Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Linux - custom shell function
#Edite o arquivo:
~/.bashrc
#Adicione as funções desejadas:
php()
{
docker run -it --rm -v $HOME/.ssh:/root/.ssh -v $('pwd'):/var/www jaschweder/php php "$@"
}
iphp()
{
docker run -it --rm -v $HOME/.ssh:/root/.ssh -v $('pwd'):/var/www jaschweder/php bash
}
composer()
{
docker run -it --rm -v $HOME/.ssh:/root/.ssh -v $('pwd'):/usr/src -w /usr/src composer/composer "$@"
}
phpunit()
{
docker run -it --rm -v $HOME/.ssh:/root/.ssh -v $('pwd'):/var/www -w /var/www jaschweder/php ./vendor/bin/phpunit "$@"
}
npm()
{
docker run -it --rm -v $HOME/.ssh:/root/.ssh -v $('pwd'):/usr/src -w /usr/src monostream/nodejs-gulp-bower npm "$@"
}
gulp()
{
docker run -it --rm -v $HOME/.ssh:/root/.ssh -v $('pwd'):/usr/src -w /usr/src monostream/nodejs-gulp-bower gulp "$@"
}
bower()
{
docker run -it --rm -v $HOME/.ssh:/root/.ssh -v $('pwd'):/usr/src -w /usr/src monostream/nodejs-gulp-bower bower "$@" --allow-root
}
#Salve o arquivo
#Reinicie o serviço:
. ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment