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

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

santiagon610 added a commit to santiagon610/personal-website that referenced this pull request Sep 28, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [postcss-cli](https://github.com/postcss/postcss-cli) | [`^7.1.2` → `^12.0.0`](https://renovatebot.com/diffs/npm/postcss-cli/7.1.2/12.0.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/postcss-cli/12.0.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/postcss-cli/7.1.2/12.0.0?slim=true) |

---

### Release Notes

<details>
<summary>postcss/postcss-cli (postcss-cli)</summary>

### [`v12.0.0`](https://github.com/postcss/postcss-cli/blob/HEAD/CHANGELOG.md#1200--2026-09-04)

[Compare Source](postcss/postcss-cli@11.0.1...12.0.0)

- If using a YAML config, the `yaml` package must be installed separately ([#&#8203;478](postcss/postcss-cli#478))
- Requires Node.js v22+ ([#&#8203;525](postcss/postcss-cli#525))
- Errors if `--config` is passed, but no config is found ([#&#8203;467](postcss/postcss-cli#467), [#&#8203;522](postcss/postcss-cli#522))
- Now properly exits with an error if invalid options/configuration are passed in watch mode ([#&#8203;527](postcss/postcss-cli#527))
- Upgrade to chokidar v5; which results in slightly different handling of `dir-dependency` messages in watch mode ([#&#8203;501](postcss/postcss-cli#501))
- Properly watchs all config files if there are multiple config files ([#&#8203;536](postcss/postcss-cli#536))
- Minimized dependencies by removing fs-extra ([#&#8203;510](postcss/postcss-cli#510))
- Internal refactoring

### [`v11.0.1`](https://github.com/postcss/postcss-cli/blob/HEAD/CHANGELOG.md#1101--2025-03-12)

[Compare Source](postcss/postcss-cli@11.0.0...11.0.1)

- Update and minimize dependencies

### [`v11.0.0`](https://github.com/postcss/postcss-cli/blob/HEAD/CHANGELOG.md#1100--2023-12-05)

[Compare Source](postcss/postcss-cli@10.1.0...11.0.0)

- **BREAKING:** Require Node.js v18+ ([#&#8203;464](postcss/postcss-cli#464))
- Upgrade to [`postcss-load-config@5`](https://github.com/postcss/postcss-load-config/blob/main/CHANGELOG.md#50-2023-11-20) for improved ESM & TS config support ([#&#8203;461](postcss/postcss-cli#461), [#&#8203;462](postcss/postcss-cli#462))

### [`v10.1.0`](https://github.com/postcss/postcss-cli/blob/HEAD/CHANGELOG.md#1010--2022-11-29)

[Compare Source](postcss/postcss-cli@10.0.0...10.1.0)

- Allow running `--watch` mode in non-TTY contexts, like Docker ([#&#8203;448](postcss/postcss-cli#448))
- Update dependencies

### [`v10.0.0`](https://github.com/postcss/postcss-cli/blob/HEAD/CHANGELOG.md#1000--2022-06-29)

[Compare Source](postcss/postcss-cli@9.1.0...10.0.0)

- **BREAKING:** Drop Node 12 support ([#&#8203;438](postcss/postcss-cli#438))
- Add support for ESM config files ([#&#8203;437](postcss/postcss-cli#437))

### [`v9.1.0`](https://github.com/postcss/postcss-cli/blob/HEAD/CHANGELOG.md#910--2021-12-10)

[Compare Source](postcss/postcss-cli@9.0.2...9.1.0)

- Don't write to files if they're unchanged ([#&#8203;320](postcss/postcss-cli#320), [#&#8203;417](postcss/postcss-cli#417))

### [`v9.0.2`](https://github.com/postcss/postcss-cli/blob/HEAD/CHANGELOG.md#902--2021-11-04)

[Compare Source](postcss/postcss-cli@9.0.1...9.0.2)

- Switch to picocolors ([#&#8203;409](postcss/postcss-cli#409))
- Remove test files from npm package

### [`v9.0.1`](https://github.com/postcss/postcss-cli/blob/HEAD/CHANGELOG.md#901--2021-09-28)

[Compare Source](postcss/postcss-cli@9.0.0...9.0.1)

- Actually exit with error when attempting to stdout in watch mode
- Remove `bin/` from `files` in package.json

### [`v9.0.0`](https://github.com/postcss/postcss-cli/blob/HEAD/CHANGELOG.md#900--2021-09-24)

[Compare Source](postcss/postcss-cli@8.3.1...9.0.0)

- **BREAKING:** Require Node.js v12+
- **BREAKING:** Must specify full file path, including `.js` extension, when loading local plugins with `--use` ([#&#8203;401](postcss/postcss-cli#401))
- **BREAKING:** Officially remove support for watching postcss config (was already broken in previous releases)
- Add support for `dir-dependency` messages ([#&#8203;383](postcss/postcss-cli#383), [#&#8203;391](postcss/postcss-cli#391))
- Update deps

### [`v8.3.1`](https://github.com/postcss/postcss-cli/blob/HEAD/CHANGELOG.md#831--2020-12-12)

[Compare Source](postcss/postcss-cli@8.3.0...8.3.1)

- Ensure paths are not interpreted as numbers ([#&#8203;360](postcss/postcss-cli#360))
- Better errors for incorrect postcss version ([#&#8203;361](postcss/postcss-cli#361), [#&#8203;362](postcss/postcss-cli#362))

### [`v8.3.0`](https://github.com/postcss/postcss-cli/blob/HEAD/CHANGELOG.md#830--2020-11-17)

[Compare Source](postcss/postcss-cli@8.2.0...8.3.0)

- Exit on EOF/`^D` ([#&#8203;358](postcss/postcss-cli#358))

### [`v8.2.0`](https://github.com/postcss/postcss-cli/blob/HEAD/CHANGELOG.md#820--2020-10-29)

[Compare Source](postcss/postcss-cli@8.1.0...8.2.0)

- Allow backslashes in paths for better Windows experience ([#&#8203;355](postcss/postcss-cli#355))

### [`v8.1.0`](https://github.com/postcss/postcss-cli/blob/HEAD/CHANGELOG.md#810--2020-10-08)

[Compare Source](postcss/postcss-cli@8.0.0...8.1.0)

- Add support for `postcss.config.cjs` files ([#&#8203;351](postcss/postcss-cli#351))

### [`v8.0.0`](https://github.com/postcss/postcss-cli/blob/HEAD/CHANGELOG.md#800--2020-09-21)

[Compare Source](postcss/postcss-cli@7.1.2...8.0.0)

- **BREAKING:** Support postcss v8 ([#&#8203;344](postcss/postcss-cli#344), [#&#8203;349](postcss/postcss-cli#349))
- **BREAKING:** postcss is now a `peerDependency`, you must install it seperately ([#&#8203;344](postcss/postcss-cli#344), [#&#8203;349](postcss/postcss-cli#349))
- Upgrade dependencies ([#&#8203;340](postcss/postcss-cli#340))

</details>

---

### Configuration

📅 **Schedule**: (in timezone Etc/UTC)

- Branch creation
  - Between 12:00 AM and 03:59 AM, only on Monday (`* 0-3 * * 1`)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [x] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC42NS41IiwidXBkYXRlZEluVmVyIjoiNDQuNjUuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19-->

Co-authored-by: Renovate <renovate@users.noreply.code.inl.io>
Co-authored-by: Nicholas Santiago <nicholas.santiago@gmail.com>
Reviewed-on: https://code.inl.io/nick/personal-website/pulls/11
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