从命令行,这会在我的 phpstorm 应用程序中打开两个文件:
git diff --name-only final-migration | xargs pstorm
当我在 ~/.bash_profile 中创建别名时:
alias ropen="git diff --name-only $1 | xargs pstorm"
并从与成功命令相同的目录中调用它:
ropen final-migration
什么也没发生.. 我已经尝试更改别名,使其回显而不是xargs pstorm
按预期工作。xargs
当它在别名中使用时,这似乎是问题所在。我不确定我错过了什么。
问题出在我的 OSX 随附的 xargs 版本上。通过使用 GNU 版本,@socowi 使用函数的建议非常有效。
要安装 xargs 的 gnu 版本,我按照@Benjamin W 所说的做了,并使用自制软件安装了 findutils。然后我将安装 findutils 时建议的路径添加到我的 ~/.bash_profile 中。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句