forked from cozy/cozy-emails
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCakefile
27 lines (24 loc) · 1.03 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
fs = require 'fs'
{exec} = require 'child_process'
logger = require('printit')
date: false
prefix: 'cake'
task 'tests', (opts) ->
console.log "DEPRECATED : use npm run test:server"
task 'build', 'Build CoffeeScript to Javascript', ->
logger.options.prefix = 'cake:build'
logger.info "Start compilation..."
command = "coffee -cb --output build/server server && " + \
"coffee -cb --output build/ server.coffee && " + \
"mkdir -p build/server/views && " + \
"cp server/views/* build/server/views/ && " + \
"rm -rf build/client && mkdir build/client && " + \
"cd client/ && brunch build --production && cd .. && " + \
"coffee -cb --output build/client/app/locales client/app/locales"
exec command, (err, stdout, stderr) ->
if err
logger.error "An error has occurred while compiling:\n" + err
process.exit 1
else
logger.info "Compilation succeeded."
process.exit 0