forked from hmrc/govuk_prototype_kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.js
More file actions
29 lines (21 loc) · 636 Bytes
/
start.js
File metadata and controls
29 lines (21 loc) · 636 Bytes
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
// Check for `node_modules` folder and warn if missing
var fs = require('fs');
if (!fs.existsSync(__dirname + '/node_modules')) {
console.error('ERROR: Node module folder missing. Try running `npm install`');
process.exit(0);
}
// remove .port.tmp if it exists
try {
fs.unlinkSync(__dirname + '/.port.tmp');
} catch(e){}
var gruntfile = __dirname + '/Gruntfile.js';
require(__dirname + '/node_modules/grunt/lib/grunt.js').cli({
'gruntfile' : gruntfile
});
process.on('SIGINT', function() {
// remove .port.tmp if it exists
try {
fs.unlinkSync(__dirname + '/.port.tmp');
} catch(e){}
process.exit(0);
});