Skip to content

Commit

Permalink
diff naming
Browse files Browse the repository at this point in the history
  • Loading branch information
okwme committed Feb 10, 2018
1 parent ac64d6e commit 4bbcccf
Show file tree
Hide file tree
Showing 6 changed files with 10,263 additions and 7,846 deletions.
46 changes: 24 additions & 22 deletions bin/dapp-scratch.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,13 @@ const child_process = require('child_process');

commander
.version('0.0.1')
.usage('wrap [options]')
.option('-a, --address [address]', 'Address')
.option('-b, --abi [abi]', 'ABI')
.option('-c, --contract [contract]', 'Contract')
.usage('build [options]')
.option('-c, --contract [contract]', 'Contract name or location \n ie: SampleContract or SampleContract.sol or ./contracts/SampleContract.sol')
.option('-b, --abi [abi]', 'ABI name or location \n ie: SampleContract or SampleContract.json or ./build/contracts/SampleContract.json')
.option('-a, --address [address]', 'Address of deployed contract')



commander
.command('build')
.description('Build a dummy solidity contract for testing')
.action((command) => {
let skip = true
dappScratch = new DappScratch({skip})
dappScratch.createDummyContract()
.then(() => {
console.log('Contract Created 🎉'.green)
})
.catch((error) => {
console.log('FAILED'.red)
console.error(error)
})
})

function getContract (path) {
if (!fs.existsSync(path)) {
Expand Down Expand Up @@ -111,8 +97,8 @@ function promptInstall (index = 0, dependencies = []) {
})
}
commander
.command('wrap filename')
.description('Build Wrapper from Contract')
.command('build filename')
.description('Build a module from Contract or ABI')
.action((filename, comm) => {
if (!comm) {
comm = filename
Expand All @@ -132,7 +118,7 @@ commander
return dappScratch.createWrapper(commander.address)
})
.then(() => {
console.log(colors.green('Wrapper Created at ' + dappScratch.path))
console.log(colors.green('Module created at ' + dappScratch.path))
console.log(colors.grey(`
/*
* To use ${dappScratch.projectName} just import it into your project:
Expand Down Expand Up @@ -162,6 +148,22 @@ if (process.argv <= 2) {
process.exit(1);
}

commander
.command('test')
.description('Generate a contract for testing\n\n')
.action((command) => {
let skip = true
dappScratch = new DappScratch({skip})
dappScratch.createDummyContract()
.then(() => {
console.log('Contract Created 🎉'.green)
})
.catch((error) => {
console.log('FAILED'.red)
console.error(error)
})
})

commander.parse(process.argv)

// if (typeof directory === 'undefined') {
Expand Down
6 changes: 3 additions & 3 deletions build/contracts/Migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
"overloadedDeclarations": [
null
],
"referencedDeclaration": 3364,
"referencedDeclaration": 3390,
"type": "msg",
"value": "msg"
},
Expand Down Expand Up @@ -357,7 +357,7 @@
"overloadedDeclarations": [
null
],
"referencedDeclaration": 3364,
"referencedDeclaration": 3390,
"type": "msg",
"value": "msg"
},
Expand Down Expand Up @@ -817,5 +817,5 @@
},
"networks": {},
"schemaVersion": "1.0.1",
"updatedAt": "2018-02-10T18:06:39.457Z"
"updatedAt": "2018-02-10T18:20:00.024Z"
}
Loading

0 comments on commit 4bbcccf

Please sign in to comment.