繁体   English   中英

将shell脚本作为混​​合别名运行

[英]Running a shell script as a mix alias

如何将Shell脚本作为混​​合别名运行?

我已经尝试了以下方法,但是没有运气:

defp aliases() do
  [
    "test": [ "./scripts/test.sh" ]
  ]
end

defp aliases() do
  [
    "test": [ "scripts/test.sh" ]
  ]
end

每个返回的变化:

** (Mix) The task "./scripts/test" could not be found

您可以Mix.Tasks.Cmd使用调用Mix.Tasks.Cmd任务:

"test": ["cmd ./scripts/test.sh"]
$ cat a.sh
#!/bin/bash
echo foo
$ cat mix.exs | grep test
      "test": ["cmd ./a.sh", "cmd echo bar"]
$ mix test
foo
bar

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM