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

Use 'slash' on input files before globbing to support absolute paths with backslashes on Windows #355

merged 1 commit into from Oct 20, 2020


Copy link

globby (used to glob input arguments to postcss-cli) only supports forward slashes.
In order to be able to provide absolute paths containing backslashes to the CLI on Windows, they need to be converted to forward slashes, otherwise postcss-cli terminates with the error message 'Input Error: You must pass a valid list of files to parse'.

Copy link

Coverage Status

Coverage increased (+0.1%) to 82.237% when pulling a0d4fb0 on matthias-christen:master into c94c188 on postcss:master.

Copy link

RyanZim commented Oct 17, 2020

Forgive me for my ignorance (I've never actually run postcss on Windows), but why can't you just pass paths with forward slashes from the CLI?

Copy link
Contributor Author

matthias-christen commented Oct 19, 2020

@RyanZim, on Windows, the natural directory separator is a backslash. For instance, if you tab-autocomplete a path in a Windows command line, it will convert forward slashes to backslashes. So, in particular for a command line tool, I think it is important to accept paths in the system's standard format.
What is really confusing currently: if you supply a (seemingly) perfectly valid absolute path to postcss, you'll get the error message "Input Error: You must pass a valid list of files to parse". I guess you could also adjust the error message that the user must enter forward slashes, but why not just do it right when the fix is so simple.

Copy link

@RyanZim RyanZim left a comment

Choose a reason for hiding this comment

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

Got it, tab-autocomplete. That makes sense; LGTM.

@RyanZim RyanZim merged commit c634575 into postcss:master Oct 20, 2020
2 checks passed
Copy link

RyanZim commented Oct 20, 2020

Will try to release this later this week.

Copy link

RyanZim commented Oct 29, 2020

Eh, that was a bit longer than a week. Regardless, published in v8.2.0. 🚀

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

Successfully merging this pull request may close these issues.

None yet

3 participants