Updates to boilerplate and template creation

Update `test` command to run `embark test`
Update `name` in `package.json` to be something more easily replaceable.
Use `sed` to replace above flag with DApp name
This commit is contained in:
DeviateFish 2017-02-25 14:34:45 -08:00
parent a0f4953c17
commit 289ece9df6
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",
"description": "",
"main": "Gruntfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "embark test"
},
"author": "",
"license": "ISC",

View File

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

View File

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