Skip to content

Commit eee8880

Browse files
author
José Valim
committed
Merge pull request #1501 from AtKaaZ/mixenvWindows1
fixing a test to also work in Windows
2 parents 318716a + 004bfc4 commit eee8880

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/mix/test/mix/cli_test.exs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ defmodule Mix.CLITest do
55

66
test "env" do
77
in_fixture "only_mixfile", fn ->
8-
env = System.cmd %b(MIX_ENV=prod #{elixir_executable} #{mix_executable} run "IO.puts Mix.env")
8+
if match? { :win32, _ }, :os.type do
9+
temp_env = "set MIX_ENV=prod &"
10+
else # ie. linux
11+
temp_env = "MIX_ENV=prod"
12+
end
13+
14+
env = System.cmd %b(#{temp_env} #{elixir_executable} #{mix_executable} run -e "IO.puts Mix.env")
915
assert env =~ "prod"
1016
end
1117
end

0 commit comments

Comments
 (0)