-
Notifications
You must be signed in to change notification settings - Fork 20
/
template.js
30 lines (26 loc) · 949 Bytes
/
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
var exec = require("child_process").exec;
var path = require("path");
exports.description = "A standard starting-point for news app development at NPR."
exports.template = function(grunt, init, done) {
//prelims
var here = path.basename(process.cwd());
//process
init.process(init.defaults, [
init.prompt("author_name"),
init.prompt("app_name", here),
init.prompt("app_description"),
init.prompt("github_repo", "nprapps/" + here)
], function(err, props) {
//add environment variables, dynamic properties
var root = init.filesToCopy(props);
init.copyAndProcess(root, props, { noProcess: "src/assets/**" });
grunt.file.mkdir("data");
grunt.file.mkdir("src/assets/synced");
//install node modules
console.log("Installing Node modules...");
exec("npm install --cache-min 999999", function(err, stdin, stderr) {
if (err) console.error(stdin, stderr);
done();
});
});
};