Skip to content

Commit e2889ae

Browse files
committed
updated gitignore file
1 parent 97ca2d9 commit e2889ae

File tree

4 files changed

+49
-8
lines changed

4 files changed

+49
-8
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ logs
44
npm-debug.log*
55
.node-xmlhttprequest-sync-[0-9]*
66

7-
# Compiled
8-
build
9-
index.js
10-
117
# Dependency directories
128
node_modules
139

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ Tools for bulk deployment, upgrade and interaction with smart contracts
66
## Get Starting
77

88
```bash
9-
npm i @windingtree/smart-contracts-tools -g
9+
npm i -g @windingtree/smart-contracts-tools
10+
```
11+
12+
## Usage:
13+
14+
All commands must be executed from the root of the smart contract repository
15+
16+
```bash
17+
tools --network <NETWORK_NAME> cmd=<COMMAND> <PARAMETERS>
1018
```
1119

1220
## Commands
@@ -18,8 +26,6 @@ npm i @windingtree/smart-contracts-tools -g
1826
- [call](#call)
1927
- [task](#task)
2028

21-
Usage: `orgid-tools --network <NETWORK_NAME> cmd=<COMMAND> <PARAMETERS>`
22-
2329
## version
2430

2531
Usage: `cmd=version`

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@windingtree/smart-contracts-tools",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Tools for bulk deployment, upgrade and interaction with smart contracts",
55
"bin": {
66
"tools": "src/index.js"

src/index.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env node
2+
const { spawn } = require('child_process');
3+
const { isFileExists } = require('./utils/common');
4+
5+
const basePath = process.cwd();
6+
7+
if (!isFileExists(basePath, '.openzeppelin/project.json')) {
8+
return console.log(`Error: Openzeppelin configuration not found on the path: "${basePath}/.openzeppelin/project.json"`);
9+
}
10+
11+
if (!isFileExists(basePath, 'truffle.js')) {
12+
return console.log(`Error: Truffle configuration not found on the path: "${basePath}/truffle.js"`);
13+
}
14+
15+
// Compose command line
16+
const args = ['truffle', 'exec', `${__dirname}/cli.js`, `basePath=${basePath}`];
17+
Array.prototype.push.apply(args, process.argv.slice(2));
18+
19+
if (!args.includes('--network')) {
20+
return console.log('Error: "--network" parameter is required');
21+
}
22+
23+
const cmd = spawn('npx', args);
24+
25+
cmd.stdout.on('data', data => {
26+
console.log(data.toString().replace(/[\n\r]$/, ''));
27+
});
28+
29+
cmd.stderr.on('data', data => {
30+
console.error(data.toString().replace(/[\n\r]$/, ''));
31+
});
32+
33+
cmd.on('close', code => {
34+
process.exit(code);
35+
});
36+
37+
cmd.on('error', function (err) {
38+
throw err;
39+
});

0 commit comments

Comments
 (0)