cardanocli-js icon indicating copy to clipboard operation
cardanocli-js copied to clipboard

os independent file paths

Open ggcaponetto opened this issue 2 years ago • 2 comments

The scripts currently don't work under windows.

Commands like typeof window !== "undefined" || execSync(`mkdir -p ${this.dir}/tmp`); fail. It would be a nice feature if all platforms would be supported.

Currently it works under WSL but making a debugger work is still more complicated than it could.

ggcaponetto avatar Dec 03 '21 08:12 ggcaponetto

Could you please share the errors you get?

miguelaeh avatar Apr 02 '22 11:04 miguelaeh

I was able to reproduce the issue on a MacOS. It looks like the window object is defined for some reason, getting the following error on the tests:

 FAIL  test/index.test.js
  ● Test suite failed to run

    TypeError: execSync is not a function

      125 |       options.shelleyGenesisPath &&
      126 |         (this.shelleyGenesis = JSON.parse(
    > 127 |           execSync(`cat ${options.shelleyGenesisPath}`).toString()
          |           ^
      128 |         ));
      129 |
      130 |       options.socketPath &&

      at new CardanocliJs (index.js:127:11)
      at Object.<anonymous> (test/index.test.js:14:19)

Could you confirm that is the same as in Windows?

miguelaeh avatar Apr 18 '22 20:04 miguelaeh