<commit_before># Snag [![Build Status](https://travis-ci.org/Tonkpils/snag.svg?branch=wip)](https://travis-ci.org/Tonkpils/snag) [![Coverage Status](https://coveralls.io/repos/Tonkpils/snag/badge.svg?branch=coverage&service=github)](https://coveralls.io/github/Tonkpils/snag?branch=coverage)

An automatic build tool for all your needs

![](http://i.imgur.com/epcicvr.gif)

## Installation

If you have [go](http://golang.org/) installed and want to install
the latest and greatest you can run:

```go
$ go get github.com/Tonkpils/snag
```

If you do not have go installed on your machine, you can checkout
the [releases](https://github.com/Tonkpils/snag/releases) section to
download the binary for your platform.

## Usage

Snag works by reading a `.snag.yml` file which contains a set of
commands, ignored directories, and options.

As an example, the file with these contents:

```yml
script:
  - echo "hello world"
  - go test
ignore:
  - .git
verbose: true
```

will make snag run the commands `echo "hello world"` and `go test`,
ignoring changes in the `.git` directory, and returning output on success
through the `verbose` option.

Simply run:

```
snag
```

From a project with a `.snag.yml` file and develop away!

## Caveats 

* Endless build loops

Snag will run your configured scripts if **ANY** file modifed in your current directory.
If you scripts generate any files, you should add them to the `ignore` section in your
`.snag.yml` to avoid an endless build loop.


## Known Issues

* `open /dev/null: too many open files`

You may experience this error if you're running on OSX. You may need to bump
the maximum number of open file on your machine. You can refer to [this](http://krypted.com/mac-os-x/maximum-files-in-mac-os-x/)
article for more information on the max files on OSX and [this](http://superuser.com/questions/433746/is-there-a-fix-for-the-too-many-open-files-in-system-error-on-os-x-10-7-1) superuser post for a solution<commit_msg>adding more detail to readme<commit_after># Snag [![Build Status](https://travis-ci.org/Tonkpils/snag.svg?branch=wip)](https://travis-ci.org/Tonkpils/snag) [![Coverage Status](https://coveralls.io/repos/Tonkpils/snag/badge.svg?branch=coverage&service=github)](https://coveralls.io/github/Tonkpils/snag?branch=coverage)

An automatic build tool for all your needs

![](http://i.imgur.com/epcicvr.gif)

## Installation

If you have [go](http://golang.org/) installed and want to install
the latest and greatest you can run:

```go
$ go get github.com/Tonkpils/snag
```

If you do not have go installed on your machine, you can checkout
the [releases](https://github.com/Tonkpils/snag/releases) section to
download the binary for your platform.

## Usage

Snag works by reading a yaml file named `.snag.yml`. It allows you to configure what snag will
run and what it should ignore. The file **must** reside in the same
directory that you want to watch.

Here is a sample of a `.snag.yml` file:

```yml
script:
  - echo "hello world"
  - go test
ignore:
  - .git
  - myfile.ext
verbose: true
```

By default, snag will watch all files/folders within the current directory recursively.
The ignore section will tell snag to ignore any changes that happen
in the `.git` directory and any changes that happen to the `myfile.ext` file.

The script section of the file will be executed when any file is created, deleted, or modified.

Simply run:

```
snag
```

From a project with a `.snag.yml` file and develop away!

## Caveats 

* Endless build loops

Snag will run your configured scripts if **ANY** file modifed in your current directory.
If you scripts generate any files, you should add them to the `ignore` section in your
`.snag.yml` to avoid an endless build loop.


## Known Issues

* `open /dev/null: too many open files`

You may experience this error if you're running on OSX. You may need to bump
the maximum number of open file on your machine. You can refer to [this](http://krypted.com/mac-os-x/maximum-files-in-mac-os-x/)
article for more information on the max files on OSX and [this](http://superuser.com/questions/433746/is-there-a-fix-for-the-too-many-open-files-in-system-error-on-os-x-10-7-1) superuser post for a solution
{'fraction_non_alphanumeric': 0.11322549952426261, 'fraction_numerical': 0.004757373929590866, 'mean_word_length': 4.153186274509804, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6140352', 'n_tokens_mistral': 1419, 'n_tokens_neox': 1320, 'n_words': 512}