-
Notifications
You must be signed in to change notification settings - Fork 1
/
Cakefile
24 lines (18 loc) · 650 Bytes
/
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
{print} = require "util"
{spawn} = require "child_process"
echo = (child, callback) ->
child.stderr.on "data", (data) -> process.stderr.write data.toString()
child.stdout.on "data", (data) -> print data.toString()
child.on "exit", (code) -> callback?() if code is 0
make = (str) -> str.split " "
d = __dirname
queue = [
"jade -O #{d}/page/ -wP #{d}/src/index.jade"
"stylus -o #{d}/page/ -w #{d}/src/"
"coffee -o #{d}/page/ -wbc #{d}/src/"
"doodle #{d}/page/"
]
split = (str) -> str.split " "
task "dev", "watch and convert files", (callback) ->
queue.map(split).forEach (array) ->
echo (spawn array[0], array[1..]), callback