vic/mix_under
{ "defaultBranch": "master", "description": "Execute mix tasks under Elixir umbrella applications", "fullName": "vic/mix_under", "homepage": "", "language": "Elixir", "name": "mix_under", "pushedAt": "2018-04-27T17:14:31Z", "stargazersCount": 20, "updatedAt": "2024-04-22T05:05:21Z", "url": "https://github.com/vic/mix_under"}mix under
Section titled “mix under”Execute mix tasks under specific umbrella apps, useful for running ecto migrations or tests.
mix under GLOB [TASK...]Example
Section titled “Example”Having an example umbrella app like:
example/ apps/ earth/ heaven/ hell/This will run test on a single app
$ mix under heaven testHeaven..
Finished in 0.05 seconds1 doctest, 1 test, 0 failures
Randomized with seed 132550Or you can use a glob (be sure to quote it to prevent your shell from expanding the glob itself)
$ mix under 'he*' testHeaven..
Finished in 0.05 seconds1 doctest, 1 test, 0 failures
Randomized with seed 941219
.Hell.
Finished in 0.05 seconds1 doctest, 1 test, 0 failures
Randomized with seed 862534How about mix cmd --app heaven mix test?
Section titled “How about mix cmd --app heaven mix test?”Well, you can of course use it if you dont mind writing a bit more :), (you can always create an alias in your umbrella to run those long commands for you).
Under any directory
Section titled “Under any directory”When the glob given to mix under looks like a path (it contains /), the glob
is used directly without prepending apps/ to it.
mix under apps/hell testThis means, you can execute mix on any directory, not only below your umbrella.
mix under /other/project testUnder relative task arguments
Section titled “Under relative task arguments”When the task you are executing expects a path to a file to work with (for example for
executing a script or only one test file), mix under will convert given relative paths
to absolute.
This comes handy for executing mix from inside your IDE which would probably use paths relative to your project root.
$ mix under earth test apps/earth/test/angel_test.exs==> (under apps/earth) mix test /home/vic/h/mix_under/example/apps/earth/test/angel_test.exsEarth.Angel.
Finished in 0.04 seconds1 test, 0 failures
Randomized with seed 700004Installation
Section titled “Installation”$ mix archive.install github vic/mix_under