Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detectSuperJson incorrectly returns path relative to fs.cwd() instead of user provided cwd. #315

Open
TheEdward162 opened this issue Dec 21, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@TheEdward162
Copy link
Contributor

fileSystem.path.cwd(),

The function uses recursion and taints its own cwd parameter. Later uses the filesystem cwd to create a relative path to return. This is incorrect since the point of passing in a cwd is for the function to work relative to that, not the filesystem cwd. Alternatively it could rely solely on the filesystem cwd (since the caller has a chance to modify it) and remove the cwd parameter

This bug only manifests when the cwd argument is not the same as the process cwd, such as when running in vscode extension.

I'm not sure what the callsites of this function are since CLI uses its own version of this function (rather, this function is probably based on the one in CLI).

@TheEdward162 TheEdward162 added the bug Something isn't working label Dec 21, 2022
@TheEdward162 TheEdward162 changed the title detectSuperJson incorrectly returns path to fs.cwd() instead of user provided cwd. detectSuperJson incorrectly returns path relative to fs.cwd() instead of user provided cwd. Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant