# `mix guard`
[🔗](https://github.com/slashmili/ex_guard/blob/v1.7.0/lib/mix/tasks/guard.ex#L1)

ExGuard automates various tasks by running custom rules whenever file or directories are modified.

## Usage
    usage: mix guard [--config=.exguard.exs]
    help: mix help guard

## Installation

add `ex_guard` to `mix.exs`

    def deps do
      [{:ex_guard, "~> 1.7", only: :dev}]
    end

## Sample config file

Create .exguard.exs in your root mix directory:
    use ExGuard.Config

    guard("unit-test")
    |> command("mix test --color")
    #config that match specific files:
    |> watch({~r{lib/(?<dir>.+)/(?<file>.+).ex$}, fn(m) -> "test/#{m["dir"]}/#{m["file"]}_test.exs" end})
    #if a file doesn't match with above pattern, this below pattern will be tested and applied
    |> watch(~r{\\.(erl|ex|exs|eex|xrl|yrl)\\z}i)
    |> ignore(~r/priv/)

Run `mix guard` and happy coding.

[Check out here for more fine-grained configs](https://hexdocs.pm/ex_guard/ExGuard.Guard.html).

## Notifications

Notify the result of execution through:
  * [Terminal Title](http://tldp.org/HOWTO/Xterm-Title-3.html) (Xterm)
  * [TMux](http://tmux.github.io/) (Universal)
  * [Terminal Notifier](https://github.com/julienXX/terminal-notifier) (mac only)
  * [Notify Send](http://ss64.com/bash/notify-send.html) (linux distros)

# `execute`

# `run`

---

*Consult [api-reference.md](api-reference.md) for complete listing*
