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:
parent
a0f4953c17
commit
289ece9df6
|
@ -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",
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue