mirror of
https://github.com/status-im/embark-area-51.git
synced 2025-01-10 22:16:20 +00:00
add --simple option
This commit is contained in:
parent
a8e22ec45c
commit
4c82f309e0
16
lib/cmd.js
16
lib/cmd.js
@ -43,7 +43,8 @@ class Cmd {
|
||||
program
|
||||
.command('new [name]')
|
||||
.description('new application')
|
||||
.action(function (name) {
|
||||
.option('--simple', 'create a barebones project meant only for contract development')
|
||||
.action(function (name, options) {
|
||||
if (name === undefined) {
|
||||
return promptly.prompt("Name your app (default is embarkDApp):", {
|
||||
default: "embarkDApp",
|
||||
@ -56,13 +57,20 @@ class Cmd {
|
||||
err.retry();
|
||||
} else {
|
||||
//slightly different assignment of name since it comes from child prompt
|
||||
embark.generateTemplate('boilerplate', './', inputvalue);
|
||||
if (options.simple) {
|
||||
embark.generateTemplate('simple', './', inputvalue);
|
||||
} else {
|
||||
embark.generateTemplate('boilerplate', './', inputvalue);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
embark.generateTemplate('boilerplate', './', name);
|
||||
if (options.simple) {
|
||||
embark.generateTemplate('simple', './', name);
|
||||
} else {
|
||||
embark.generateTemplate('boilerplate', './', name);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
5
templates/simple/.gitignore
vendored
Normal file
5
templates/simple/.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
.embark/
|
||||
node_modules/
|
||||
dist/
|
||||
config/production/password
|
||||
config/livenet/password
|
1
templates/simple/chains.json
Normal file
1
templates/simple/chains.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
20
templates/simple/contracts.json
Normal file
20
templates/simple/contracts.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"default": {
|
||||
"versions": {
|
||||
"web3.js": "1.0.0-beta",
|
||||
"solc": "0.4.17"
|
||||
},
|
||||
"deployment": {
|
||||
"host": "localhost",
|
||||
"port": 8545,
|
||||
"type": "rpc"
|
||||
},
|
||||
"dappConnection": [
|
||||
"$WEB3",
|
||||
"http://localhost:8545"
|
||||
],
|
||||
"gas": "auto",
|
||||
"contracts": {
|
||||
}
|
||||
}
|
||||
}
|
0
templates/simple/contracts/.gitkeep
Normal file
0
templates/simple/contracts/.gitkeep
Normal file
7
templates/simple/embark.json
Normal file
7
templates/simple/embark.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"contracts": ["contracts/**"],
|
||||
"app": {},
|
||||
"buildDir": "build/",
|
||||
"config": "./",
|
||||
"plugins": {}
|
||||
}
|
13
templates/simple/package.json
Normal file
13
templates/simple/package.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "%APP_NAME%",
|
||||
"version": "0.0.1",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"test": "embark test"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"homepage": "",
|
||||
"devDependencies": {
|
||||
}
|
||||
}
|
29
templates/simple/test/contract_spec.js
Normal file
29
templates/simple/test/contract_spec.js
Normal file
@ -0,0 +1,29 @@
|
||||
//describe("SimpleStorage", function() {
|
||||
// this.timeout(0);
|
||||
// before(function(done) {
|
||||
// this.timeout(0);
|
||||
// var contractsConfig = {
|
||||
// "SimpleStorage": {
|
||||
// args: [100]
|
||||
// }
|
||||
// };
|
||||
// EmbarkSpec.deployAll(contractsConfig, () => { done() });
|
||||
// });
|
||||
//
|
||||
// it("should set constructor value", function(done) {
|
||||
// SimpleStorage.methods.storedData().call().then(function(result) {
|
||||
// assert.equal(result, 100);
|
||||
// done();
|
||||
// });
|
||||
// });
|
||||
//
|
||||
// it("set storage value", function(done) {
|
||||
// SimpleStorage.methods.set(150).send().then(function() {
|
||||
// SimpleStorage.methods.get().call().then(function(result) {
|
||||
// assert.equal(result, 150);
|
||||
// done();
|
||||
// });
|
||||
// });
|
||||
// });
|
||||
//
|
||||
//});
|
Loading…
x
Reference in New Issue
Block a user