Giter Site home page Giter Site logo

mix_under's Introduction

mix under

Execute mix tasks under specific umbrella apps, useful for running ecto migrations or tests.

Usage

mix under GLOB [TASK...]

Example

Having an example umbrella app like:

example/
  apps/
    earth/
    heaven/
    hell/

This will run test on a single app

$ mix under heaven test
Heaven
..

Finished in 0.05 seconds
1 doctest, 1 test, 0 failures

Randomized with seed 132550

Or you can use a glob (be sure to quote it to prevent your shell from expanding the glob itself)

$ mix under 'he*' test
Heaven
..

Finished in 0.05 seconds
1 doctest, 1 test, 0 failures

Randomized with seed 941219

.Hell
.

Finished in 0.05 seconds
1 doctest, 1 test, 0 failures

Randomized with seed 862534

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

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 test

This means, you can execute mix on any directory, not only below your umbrella.

mix under /other/project test

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.exs
Earth.Angel
.

Finished in 0.04 seconds
1 test, 0 failures

Randomized with seed 700004

Installation

$ mix archive.install github vic/mix_under

mix_under's People

Contributors

merigo avatar vic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

cjimison

mix_under's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.