forked from dataarts/tailbone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Guardfile
28 lines (21 loc) · 803 Bytes
/
Guardfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
# Guardfile
# More info at https://github.com/lepture/python-livereload
from livereload.task import Task
from livereload.compiler import shell
def recursive_watch(directory, filetypes, *args, **kwargs):
import os
for root, dirs, files in os.walk(directory):
if filetypes:
towatch = set()
for filetype in filetypes:
for f in files:
if filetype in f:
towatch.add(filetype)
for filetype in towatch:
Task.add(os.path.join(root,"*.{}".format(filetype)), *args, **kwargs)
else:
Task.add(os.path.join(root, "*"), *args, **kwargs)
recursive_watch("client/app", [])
recursive_watch("tailbone", ["py", "html", "js", "css", "yaml"])
recursive_watch("client/app", ["scss"], shell('sass --update', 'client/app'))