How can you run a shell script as a mix alias?
I've tried the following with no luck:
defp aliases() do
[
"test": [ "./scripts/test.sh" ]
]
end
defp aliases() do
[
"test": [ "scripts/test.sh" ]
]
end
Each returns with a variation of:
** (Mix) The task "./scripts/test" could not be found
You can use invoke the Mix.Tasks.Cmd
task for this:
"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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With