-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathJakefile.coffee
More file actions
30 lines (25 loc) · 1.15 KB
/
Jakefile.coffee
File metadata and controls
30 lines (25 loc) · 1.15 KB
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
# require Node's filesystem methods
fs = require 'fs'
# require Node's child process creation methods
spawn = require( 'child_process' ).spawn
log = console.log
namespace 'coffee', ()->
desc 'Watches files in src and compiles them in lib'
task 'watch', [], ()->
# spawns a process that executes the command line: coffee -w -b -o ./lib -c ./src
# so that we can type "jake coffee:watch" and not have to remember coffee's arguments
cof = spawn 'coffee', ['-w', '-b', '-o', './lib', '-c', './src'], customFds: [0..5]
desc 'Compiles files in src to lib'
task 'compile', [], ()->
# spawns a process that executes the command line: coffee -b -o ./lib -c ./src
# so that we can type "jake coffee:compile" and not have to remember coffee's arguments
# can be used by git hooks
message = "\nSuccess: compiled coffeescript!\n"
trace = ''
try
cof = spawn 'coffee', ['-b', '-o', './lib', '-c', './src'], customFds: [0..5]
catch E
message = "\nFailure: failed to compile coffeescript!\n"
trace = E
log message
log trace