-
Notifications
You must be signed in to change notification settings - Fork 14
/
Gruntfile.js
66 lines (59 loc) · 1.64 KB
/
Gruntfile.js
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
module.exports = function(grunt)
{
'use strict';
var exec = require('child_process').exec;
var nwb = require('nw-builder');
grunt.registerTask('default', []);
/**
* Runs the app
*/
grunt.registerTask('run', function()
{
var done = this.async();
var child = exec('/Applications/nwjs.app/Contents/MacOS/nwjs ./app');
child.stdout.on('data', grunt.log.write);
child.stderr.on('data', grunt.log.write);
child.on('close', done);
});
/**
* Builds the app
*/
grunt.registerTask('build', function()
{
var builder = new nwb(
{
files: './app/**/**',
version: '0.12.3',
platforms: ['osx'],
buildDir: './build',
macCredits: false,
macIcns: './assets/icns/icon.icns'
});
var done = this.async();
grunt.log.writeln('Building app...');
builder.build().then(function()
{
grunt.log.ok('Build done.');
if (grunt.option('launch'))
{
exec('./build/Pawnee/osx/Pawnee.app/Contents/MacOS/nwjs');
}
done();
}).catch(function(error)
{
grunt.log.error(error);
done();
});
});
/**
* Basic SASS support
*/
grunt.registerTask('sass', function()
{
var done = this.async();
var child = exec('cd app/assets && compass watch sass/*');
child.stdout.on('data', grunt.log.write);
child.stderr.on('data', grunt.log.write);
child.on('close', done);
});
};