commercialhaskell / rio

A standard library for Haskell
Other
838 stars 54 forks source link

Fix augment path #237

Closed hasufell closed 2 years ago

hasufell commented 2 years ago

On windows, env vars are generally case-insensitive. Due to 'type EnvVars = Map Text Text' augmentPathMap assumes full uppercase "PATH" variable, which may lead to surprising behavior if the current map has a variable such as "Path".

This patch folds over the map and inserts any path key as "PATH" on windows. That also means: if there are multiple, the "last" one wins. There generally isn't a sane solution if the input map already has multiple path keys (how should they be merged, which order?).

Fixes #234

snoyberg commented 2 years ago

Released to Hackage, thanks!

snoyberg commented 2 years ago

I'll open a PR against Stack to use this newer version, unless you'd like to open that PR instead.