-
Notifications
You must be signed in to change notification settings - Fork 1
/
Cakefile
39 lines (36 loc) · 1.06 KB
/
Cakefile
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
29
30
31
32
33
34
35
36
37
38
39
{exec} = require("child_process")
task("build", "Build project from src/*.coffee to lib/*.js.", () ->
exec("coffee --compile --output lib/ src/", (err, stdout, stderr) ->
if err then throw err
console.log(stdout + stderr)
)
)
task("watch", "Watch project from src/*.coffee to lib/*.js.", () ->
exec("coffee --compile --watch --output lib/ src/", (err, stdout, stderr) ->
if err
throw err
console.log(stdout + stderr)
)
)
task("deploy", "Deploy pages branch and push master and pages branches.", () ->
exec("""
coffee --compile --output lib/ src/; \
git add .; \
git commit -m "Deployed."; \
git push origin master; \
git push coding master; \
git checkout pages; \
git checkout master lib/snake.js; \
git checkout master images/snake_qrcode.png; \
mv lib/snake.js js/snake.js; \
rmdir lib; \
git add .; \
git commit -m "Deployed."; \
git push origin pages:gh-pages; \
git push coding pages:coding-pages; \
git checkout master
""", (err, stdout, stderr) ->
if err then throw err
console.log(stdout + stderr)
)
)