From the command line, this opens two files in my phpstorm application:
git diff --name-only final-migration | xargs pstorm
When I create an alias in my ~/.bash_profile:
alias ropen="git diff --name-only $1 | xargs pstorm"
and call it from the same directory as the successful command:
ropen final-migration
Nothing happens.. I've tried altering the alias so that it echos instead of xargs pstorm
which works as expected. It seems like xargs
is where the problem lies when it's being used in an alias.. I'm not sure what I'm missing.
bash
replaces theropen
alias and your command becomesgit diff --name-only | xargs pstorm final-migration
. You have to turn your alias into a function to use arguments.ropen(){ git diff --name-only "$1" | xargs pstorm ; }
test
as it is the name of both a built-in and a binary, which can lead to anothertest
than yours being called.