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

withSymlinks doesn't work properly with relative paths on when the symlink is at the top level #113

Closed
SuperchupuDev opened this issue Aug 26, 2024 · 1 comment · Fixed by #114

Comments

@SuperchupuDev
Copy link
Contributor

the following code behaves differently when you add .withRelativePaths() and a symlink is at the top level. it looks like it just ignores symlinks completely

const b = await new fdir()
  .withSymlinks()
  .exclude(p => p.includes('.git') || p.includes('node_modules'))
  .crawl(process.cwd())
  .withPromise();

b.map(p => console.log(p));

however it works if you crawl path.join(process.cwd(), '..'). using resolvePaths: false as an argument for withSymlinks doesn't solve the issue either

it works perfectly without .withRelativePaths()

@SuperchupuDev
Copy link
Contributor Author

okay, thinking about it it makes sense that withSymlinks doesn't work with relative paths as symlinks can point to anywhere outside the root, as long as useRealPaths is true. if it's false it shouldn't be any hard to process as a relative path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant