Skip to content

case-insensitive environment variable handling on Windows breaks in bash #177

Open
@hsenag

Description

@hsenag

Since 9371a18, environment variable names on Windows are converted to lower-case. This breaks code that sets upper-case environment variables and then calls a bash script - it seems bash on Windows (in msys) is still able to distinguish case. For example before the change this code worked:

Main.hs:

     {-# LANGUAGE OverloadedStrings #-}
    module Main where

    import Shelly

    main :: IO ()
    main = shelly $ do
      setenv "WIBBLE" "upper"
      setenv "wibble" "lower"
      run "bash" ["go.sh"]

go.sh:

    #!/bin/sh

    echo WIBBLE: $WIBBLE
    echo wibble: $wibble

working output:

WIBBLE: upper
wibble: lower

broken output:

WIBBLE:
wibble: lower

CC @eric-corumdigital

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions