lepture/python-livereload — pull request #16 by jbarratt (2013-01-15 05:40:10+00:00)
Title: --directory option, allowing serving a different directory tree

I'm using [sphinx](http://sphinx-doc.org), which tends to structure things like:

```
mydoc/
Makefile
build/
html/
source/
index.rst
otherdir/
index.rst
```

so I want to watch the source/ directory, run a command and serve up build/html/. Also, it makes more sense to keep the `Guardfile` next to the `Makefile`.

This simple patch allows me to run

```
livereload -d build/html
```
with a very simple `Guardfile`

```
@functools.partial
def build_sphinx():
import subprocess
subprocess.call(['make', 'html'])
Task.add('source/', build_sphinx)
```