looks-same icon indicating copy to clipboard operation
looks-same copied to clipboard

Error when diff path contains folders that does not exist

Open alonseg opened this issue 5 years ago • 0 comments

'looks-same' saves the diff file using fs.createWriteStream(), passing that path as a parameter. Now, fs.createWriteStream() fails when the directory the path is pointing to doesn't exist - and that's the problem.

the shown error:

ENOENT: no such file or directory, open '...'

possible solutions:

  1. using fsExtra.outputFile() which creates any missing directories. (best IMO)
  2. Implementing the recursive mkdir ourselves

initially found here

alonseg avatar Apr 23 '20 07:04 alonseg