forked from aralejs/template-arale
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtemplate.js
More file actions
43 lines (33 loc) · 907 Bytes
/
Copy pathtemplate.js
File metadata and controls
43 lines (33 loc) · 907 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
'use strict';
exports.description = 'Create a CMD module.';
exports.notes = '';
exports.warnOn = '*';
exports.template = function(grunt, init, done) {
grunt.util._.extend(init.prompts, {
family: {
message: 'your CMD family',
default: '',
warning: ''
}
});
init.process({type: 'cmd'}, [
// Prompt for these values.
init.prompt('name'),
init.prompt('family'),
init.prompt('author'),
init.prompt('version', '1.0.0'),
init.prompt('description'),
init.prompt('repository'),
init.prompt('homepage'),
init.prompt('licenses', 'MIT')
], function(err, props) {
var files = init.filesToCopy(props);
props.varName = props.name.replace(/\-(\w)/g, function(all, letter){
return letter.toUpperCase();
});
// Actually copy (and process) files.
init.copyAndProcess(files, props);
// All done!
done();
});
};