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

Add absolute option for match event - closes #292 #293

Merged
merged 1 commit into from
Sep 20, 2016

Conversation

phated
Copy link
Contributor

@phated phated commented Sep 16, 2016

@isaacs Implemented as per guidance on #292 - I added a note about the caveat that this is only applied to 'match' events and not to the final results in the callback. I am not familiar enough with the code to understand the scope of making the final results absolute. Do you think it's a worth including in this feature?

@phated
Copy link
Contributor Author

phated commented Sep 19, 2016

If there is anything else you'd like me to tackle as part of this, just let me know.

Copy link
Owner

@isaacs isaacs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dug in a little bit, and found some weird bugs in the sync glob in the process. I'm going to pull in this change, but fix those other issues myself before publishing. This is good, expect a release this week. Thanks!

@@ -273,6 +273,9 @@ the filesystem.
In the case of a symlink that cannot be resolved, the full absolute
path to the matched entry is returned (though it will usually be a
broken symlink)
* `absolute` Set to true to always receive absolute paths for the
`'match'` event. Will not pass absolute paths to the callback
or returned from `glob.sync`.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a little bit surprising for the match events to be absolute, but for the results to still be relative. I'll check out the code to see how hard this is, probably I can at least point you in the right direction.

@@ -80,6 +80,7 @@ function setopts (self, pattern, options) {
self.nocase = !!options.nocase
self.stat = !!options.stat
self.noprocess = !!options.noprocess
self._absolute = !!options.absolute
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my suggestion, I'd forgotten the pattern that this module uses. Probably it should be self.absolute, to match the other settings.

@isaacs isaacs merged commit b266df3 into isaacs:master Sep 20, 2016
isaacs added a commit that referenced this pull request Sep 20, 2016
This involes a refactor of the GlobSync._emitMatch method, which it turns
out, was not being used at all.

Close #293
@isaacs
Copy link
Owner

isaacs commented Sep 20, 2016

Published as 7.1.0. Thanks!

@phated
Copy link
Contributor Author

phated commented Sep 20, 2016

Awesome! Glad I could help find issues in sync too

iarna added a commit to npm/npm that referenced this pull request Oct 7, 2016
Add absolute option for match event.

Credit: @phated
PR-URL: isaacs/node-glob#293
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 this pull request may close these issues.

None yet

2 participants