如何将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
答案 0 :(得分:2)
您可以使用调用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