-
-
Notifications
You must be signed in to change notification settings - Fork 479
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
Add an option to return real paths for symlinks #142
Comments
Related: #139 |
Patch welcome. Make sure to add tests for both sync and async behavior. The option should be |
Make sure to take advantage of the cache option to fs.realpath, so that it can avoid statting the same paths multiple times. |
Thanks. I don't have time to work on this right now, but perhaps one of Node Inspector users will be willing to contribute the patch. |
This adds support for following symlinks with * and ** patterns. Fixes isaacs#142
This adds support for following symlinks with * and ** patterns. Fixes isaacs#142 Fix option name to preferred name, add sync version test
This adds support for following symlinks with * and ** patterns. Fixes isaacs#142 Fix option name to preferred name, add sync version test Fix sync test with actual test, fix old prop name
This adds support for following symlinks with * and ** patterns. Fixes isaacs#142 Fix option name to preferred name, add sync version test Fix sync test with actual test, fix old prop name Fix tests, split off to new file
Node Inspector is using
glob
to find all javascript files that may be loaded later bynode
in order to allow developers to set breakpoints in files before they are loaded. This is useful e.g. when debugging unit-tests vianode --debug-brk
, as the test files are loaded later by the test runner.At the moment, this mechanism does not work for symlinked files (typically via
npm link {module}
), becauseglob
returns paths in project's node_modules folder, while node resolves all symlinks to real paths before passing the filename to V8.I am proposing to add a
glob
option to tell it to convert symlinks to real paths. While this can be implemented by Node Inspector as a post-processing step callingfs.realpath
on all items returned byglob
, it seems to me that we can get better performance by implementing this feature in glob, as it is alreadyfs
API.Example
File layout:
Expected result for
glob('**/*.js', { cwd: '~/my-module', realpaths: true })
:The text was updated successfully, but these errors were encountered: