gemini-testing / gemini-testing/looks-same

Error when diff path contains folders that does not exist

Open
#68 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
827
Forks
55
PR merge metrics
No merged PRs in 30d

Description

'looks-same' saves the diff file using fs.createWriteStream(), passing that path as a parameter. Now, [fs.createWriteStream()](https://github.com/gemini-testing/looks-same/blob/5406adfb1e9a7b8e61c3224addc536320cbb9897/lib/png/png.js#L49) 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](https://github.com/oblador/loki/issues/229)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in lib/png/png.js at line 49, where fs.createWriteStream() saves the diff file. Reproduce the case with a path whose parent folders do not exist, then update the save behavior so those directories are created and the diff is written successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.