-
Notifications
You must be signed in to change notification settings - Fork 0
/
volofile
39 lines (36 loc) · 886 Bytes
/
volofile
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
'use strict';
var gruntCommand;
try {
gruntCommand = require('volo-grunt');
} catch(err){
// NPM install hasn't been run yet
gruntCommand = {
summary: 'Need to run `npm install` (directly or `volo onCreate`/`volo grunt`)',
run: 'n.npm install'
};
}
module.exports = {
grunt: gruntCommand,
onCreate: {
summary: 'Called upon creation of a new project - runs `npm install`',
run: function(d, v, namedArgs, projectName){
[
'index.html',
'package.json',
'README.md'
].forEach(function (name) {
v.write(name, v.template(v.read(name), {
NAME: projectName
}));
});
// Prefix with n. so spawn knows to grab it from local
v.spawn('n.npm', 'install', {
useConsole: true
})
.then(function(){
d.resolve();
})
.fail(d.reject);
}
}
};