diff --git a/packages/ethereum-indexer-cli/.gitignore b/packages/ethereum-indexer-cli/.gitignore index 4acfcb9..2f9d709 100644 --- a/packages/ethereum-indexer-cli/.gitignore +++ b/packages/ethereum-indexer-cli/.gitignore @@ -1,4 +1,5 @@ node_modules/ dist/ *.local -output.json \ No newline at end of file +output.json +indexed/ \ No newline at end of file diff --git a/packages/ethereum-indexer-cli/CHANGELOG.md b/packages/ethereum-indexer-cli/CHANGELOG.md index 26940cf..df70cef 100644 --- a/packages/ethereum-indexer-cli/CHANGELOG.md +++ b/packages/ethereum-indexer-cli/CHANGELOG.md @@ -1,5 +1,11 @@ # ethereum-indexer-cli +## 0.6.13 + +### Patch Changes + +- mkdir for cli + ## 0.6.12 ### Patch Changes diff --git a/packages/ethereum-indexer-cli/README.md b/packages/ethereum-indexer-cli/README.md index 6bed6d0..6bb7bb9 100644 --- a/packages/ethereum-indexer-cli/README.md +++ b/packages/ethereum-indexer-cli/README.md @@ -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 ``` \ No newline at end of file diff --git a/packages/ethereum-indexer-cli/package.json b/packages/ethereum-indexer-cli/package.json index 6dcc329..1daf773 100644 --- a/packages/ethereum-indexer-cli/package.json +++ b/packages/ethereum-indexer-cli/package.json @@ -1,6 +1,6 @@ { "name": "ethereum-indexer-cli", - "version": "0.6.12", + "version": "0.6.13", "description": "", "keywords": [], "author": "", diff --git a/packages/ethereum-indexer-cli/src/index.ts b/packages/ethereum-indexer-cli/src/index.ts index 281ac7c..a95e5cc 100644 --- a/packages/ethereum-indexer-cli/src/index.ts +++ b/packages/ethereum-indexer-cli/src/index.ts @@ -85,6 +85,10 @@ export async function init(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 () => {},