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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use lstatSync instead of statSync #18

Open
ericclemmons opened this issue Jul 8, 2021 · 0 comments
Open

Use lstatSync instead of statSync #18

ericclemmons opened this issue Jul 8, 2021 · 0 comments

Comments

@ericclemmons
Copy link

Hi! 馃憢

Firstly, thanks for your work on this project! 馃檪

Today I used patch-package to patch klaw-sync@6.0.0 for the project I'm working on.

This fixes #17.

Here is the diff that solved my problem:

diff --git a/node_modules/klaw-sync/klaw-sync.js b/node_modules/klaw-sync/klaw-sync.js
index 74b87c6..6e7689a 100644
--- a/node_modules/klaw-sync/klaw-sync.js
+++ b/node_modules/klaw-sync/klaw-sync.js
@@ -13,7 +13,7 @@ function klawSync (dir, opts, ls) {
   const paths = opts.fs.readdirSync(dir).map(p => dir + path.sep + p)
   for (var i = 0; i < paths.length; i += 1) {
     const pi = paths[i]
-    const st = opts.fs.statSync(pi)
+    const st = opts.fs.lstatSync(pi)
     const item = {path: pi, stats: st}
     const isUnderDepthLimit = (!opts.rootDepth || pi.split(path.sep).length - opts.rootDepth < opts.depthLimit)
     const filterResult = opts.filter ? opts.filter(item) : true

This issue body was partially generated by patch-package.

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

No branches or pull requests

1 participant