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

Fix ember-template-recast bin script file selection for Windows users #147

Merged
merged 1 commit into from Oct 16, 2019

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Oct 16, 2019

globby uses the fast-glob package, which states this in its README (RE:
patterns):

⚠️ Always use forward-slashes in glob expressions (patterns and ignore
option). Use backslashes for escaping characters.

Previously, we were using path.join which will use the OS specific
separator and therefore fail to match files when invoked with a
directory path directly.

globby has an explicit API that allows us to avoid doing this
path.join at all (expandDirectories). This changes to use that,
remove the manual joining.


This also corrects for a bug in globby (to be reported/fixed separately)
where the cwd option is defaulted to process.cwd() without posix
correction, and then subsequently an assertion is made that a given path
"starts with" the cwd.

globby uses the fast-glob package, which states this in its README (RE:
patterns):

> ⚠️ Always use forward-slashes in glob expressions (patterns and ignore
> option). Use backslashes for escaping characters.

Previously, we were using `path.join` which will use the OS specific
separator and therefore fail to match files when invoked with a
directory path directly.

globby has an explicit API that allows us to avoid doing this
`path.join` at all (`expandDirectories`). This changes to use that,
remove the manual joining.

---

This also corrects for a bug in globby (to be reported/fixed separately)
where the `cwd` option is defaulted to `process.cwd()` _without_ posix
correction, and then subsequently an assertion is made that a given path
"starts with" the cwd.
@rwjblue rwjblue mentioned this pull request Oct 16, 2019
4 tasks
@rwjblue rwjblue merged commit 73c6cc2 into ember-template-lint:master Oct 16, 2019
@rwjblue rwjblue deleted the globby-tweaks branch October 16, 2019 17:50
@rwjblue rwjblue added the bug Something isn't working label Oct 16, 2019
@rwjblue rwjblue changed the title Avoid issues with non-posix paths with globby Fix ember-template-recast bin script file selection for Windows users Oct 16, 2019
@rwjblue rwjblue changed the title Fix ember-template-recast bin script file selection for Windows users Fix ember-template-recast bin script file selection for Windows users Oct 16, 2019
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

Successfully merging this pull request may close these issues.

None yet

1 participant