gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 21:24:10 26 4
gpt4 key购买 nike

如何将 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为此任务:

"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

关于elixir - 将 shell 脚本作为混​​合别名运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49634708/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com