Skip to content

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

Merged
RyanZim merged 1 commit into
postcss:masterfrom
matthias-christen:master
Oct 20, 2020
Merged

Use 'slash' on input files before globbing to support absolute paths with backslashes on Windows#355
RyanZim merged 1 commit into
postcss:masterfrom
matthias-christen:master

Conversation

@matthias-christen

Copy link
Copy Markdown
Contributor

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'.

@coveralls

Copy link
Copy Markdown

Coverage Status

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

@RyanZim

RyanZim commented Oct 17, 2020

Copy link
Copy Markdown
Collaborator

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?

@matthias-christen

matthias-christen commented Oct 19, 2020

Copy link
Copy Markdown
Contributor Author

@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.

@RyanZim RyanZim left a comment

Copy link
Copy Markdown
Collaborator

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
@RyanZim

RyanZim commented Oct 20, 2020

Copy link
Copy Markdown
Collaborator

Will try to release this later this week.

@RyanZim

RyanZim commented Oct 29, 2020

Copy link
Copy Markdown
Collaborator

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants