Skip to content

Commit

Permalink
mkdir for cli
Browse files Browse the repository at this point in the history
  • Loading branch information
wighawag committed Nov 24, 2023
1 parent 7527914 commit e95c0ef
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/ethereum-indexer-cli/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
dist/
*.local
output.json
output.json
indexed/
6 changes: 6 additions & 0 deletions packages/ethereum-indexer-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ethereum-indexer-cli

## 0.6.13

### Patch Changes

- mkdir for cli

## 0.6.12

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum-indexer-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
## test

```bash
pnpm cli -p ../../../../wighawag/jolly-roger/indexer/dist/index.cjs -n http://localhost:8545 -f output.json -d ../../../../wighawag/jolly-roger/contracts/deployments/localhost
pnpm cli -p ../../../../wighawag/jolly-roger/indexer/dist/index.cjs -n http://localhost:8545 -f indexed/localhost.json -d ../../../../wighawag/jolly-roger/contracts/deployments/localhost
```
2 changes: 1 addition & 1 deletion packages/ethereum-indexer-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ethereum-indexer-cli",
"version": "0.6.12",
"version": "0.6.13",
"description": "",
"keywords": [],
"author": "",
Expand Down
4 changes: 4 additions & 0 deletions packages/ethereum-indexer-cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ export async function init<ABI extends Abi, ProcessResultType>(options: Options)
},
save: async (context, all) => {
const data = {lastSync: all.lastSync, state: all.state, history: all.history};
const dirname = path.dirname(options.file);
if (!fs.existsSync(dirname)) {
fs.mkdirSync(dirname, {recursive: true});
}
fs.writeFileSync(options.file, JSON.stringify(data, bnReplacer, 2));
},
clear: async () => {},
Expand Down

0 comments on commit e95c0ef

Please sign in to comment.