yerofey / cryptowallet-cli

CW: a crypto wallet generator CLI tool for a lot of blockchains (Bitcoin, Ethereum, Solana, TON and many others)
https://www.npmjs.com/package/@yerofey/cryptowallet-cli
MIT License
104 stars 46 forks source link

fix: decode chains folder path URI before use #16

Closed nd0ut closed 1 year ago

nd0ut commented 1 year ago

Fixes a bug where code fails when there are spaces in the node path:

❯ cw
node:fs:1451
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, scandir '/Users/nd0ut/Library/Application%20Support/fnm/node-versions/v18.13.0/installation/lib/node_modules/@yerofey/cryptowallet-cli/src/chains/'
    at readdirSync (node:fs:1451:3)
    at filesList (file:///Users/nd0ut/Library/Application%20Support/fnm/node-versions/v18.13.0/installation/lib/node_modules/@yerofey/cryptowallet-cli/src/utils.js:8:10)
    at file:///Users/nd0ut/Library/Application%20Support/fnm/node-versions/v18.13.0/installation/lib/node_modules/@yerofey/cryptowallet-cli/src/utils.js:38:1
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25) {
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path: '/Users/nd0ut/Library/Application%20Support/fnm/node-versions/v18.13.0/installation/lib/node_modules/@yerofey/cryptowallet-cli/src/chains/'
}

Node.js v18.13.0
yerofey commented 1 year ago

Thanks @nd0ut !