-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtemplate.js
55 lines (45 loc) · 1.49 KB
/
template.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
'use strict';
// Basic template description.
exports.description = 'Scaffolds a new Modern Style project.';
// Template-specific notes to be displayed after question prompts.
exports.after = 'You should now install project dependencies with _npm install_.'+
'Next run _bower install_ to install Modern Map API.';
// Any existing file or directory matching this wildcard will cause a warning.
exports.warnOn = '*';
// The actual init template.
exports.template = function(grunt, init, done) {
init.process({}, [
// Prompt for these values.
init.prompt('name'),
init.prompt('description'),
init.prompt('version')
], function(err, props) {
// Files to copy (and process).
var files = init.filesToCopy(props);
// Actually copy (and process) files.
init.copyAndProcess(files, props);
// Generate package.json file, used by npm and grunt.
init.writePackageJSON('package.json', {
name: props.name,
description: props.description,
version: props.version,
devDependencies: {
"grunt": "^v0.4.5",
"grunt-contrib-sass": "^v0.8.1",
"grunt-contrib-watch": "^v0.6.1",
"grunt-autoprefixer": "^2.0.0"
}
});
// Generate bower.json file, used to install bower dependancs.
init.writePackageJSON('bower.json', {
name: props.name,
description: props.description,
version: props.version,
devDependencies: {
"modern-map": ""
}
});
// All done!
done();
});
};