Merge pull request #224 from DeviateFish/update-package-test

Updates to boilerplate and template creation
This commit is contained in:
Iuri Matias 2017-02-25 19:30:02 -05:00 committed by GitHub
commit 3ab41f086a
3 changed files with 8 additions and 3 deletions

View File

@ -1,10 +1,9 @@
{ {
"name": "app_name", "name": "%APP_NAME%",
"version": "0.0.1", "version": "0.0.1",
"description": "", "description": "",
"main": "Gruntfile.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "embark test"
}, },
"author": "", "author": "",
"license": "ISC", "license": "ISC",

View File

@ -11,6 +11,7 @@ TemplateGenerator.prototype.generate = function(destinationFolder, name) {
fs.copySync(templatePath, destinationFolder + name); fs.copySync(templatePath, destinationFolder + name);
utils.cd(destinationFolder + name); utils.cd(destinationFolder + name);
utils.sed('package.json', '%APP_NAME%', name);
console.log('Installing packages.. this can take a few seconds'.green); console.log('Installing packages.. this can take a few seconds'.green);
utils.runCmd('npm install'); utils.runCmd('npm install');

View File

@ -45,6 +45,10 @@ function cd(folder) {
shelljs.cd(folder); shelljs.cd(folder);
} }
function sed(file, pattern, replace) {
shelljs.sed('-i', pattern, replace, file);
}
function exit(code) { function exit(code) {
process.exit(code); process.exit(code);
} }
@ -57,6 +61,7 @@ module.exports = {
checkIsAvailable: checkIsAvailable, checkIsAvailable: checkIsAvailable,
runCmd: runCmd, runCmd: runCmd,
cd: cd, cd: cd,
sed: sed,
exit: exit exit: exit
}; };