Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 54 lines (46 sloc) 1.511 kb
1b4140e @donpark initial check-in
authored
1 import os
2 import time
3 from fabric.api import *
4 from fabric.contrib.console import confirm
5 from fabric.contrib.project import rsync_project
6
7 def old():
8 local("npm outdated")
9
10 def remove_compiled(in_type, out_type, dirs = "."):
11 with settings(warn_only=True):
12 with lcd("."):
13 files = local(("find %s -name \*%s" % (dirs, in_type)), capture=True)
14 lines = files.split('\n')
15 for line in lines:
16 if line.find("node_modules") == -1:
17 path, ext = os.path.splitext(line)
18 path += out_type
19 if os.path.exists(path):
20 local("rm %s" % path)
21
22 def clean():
23 with settings(warn_only=True):
24 remove_compiled(".coffee", ".js")
25 remove_compiled(".styl", ".css")
26 remove_compiled(".jade", ".html")
27
28 def build():
29 with settings(warn_only=True):
30 local("coffee -c *.coffee")
31 local("coffee -c lib")
32 local("coffee -c public")
33 local("coffee -c routes")
34 local("stylus public/css")
35 local("jade public")
36
37 def dev():
38 build()
39 local("node app.js")
40
8ea2004 @donpark dist
authored
41 def site():
758dd1d @donpark gh-pages related tweaks. dev mode might need fixing.
authored
42 build()
43 local("cp public/js/*.js gh-pages/demos/js")
44 local("cp public/css/*.css gh-pages/demos/css")
45 local("jade -P -O gh-pages/demos views/demo.jade")
46 local("jade -P -O gh-pages/demos views/mixins/playingcards.jade")
8ea2004 @donpark dist
authored
47
48 def dist():
49 build()
50 local("jade -P -O dist views/mixins/playingcards.jade")
51 local("cp public/css/playingcards.css dist")
52 local("cp public/js/playingcards.js dist")
53 # local("uglifyjs dist/playingcards.js > dist/playingcards.min.js")
54
Something went wrong with that request. Please try again.