Skip to content

Commit adaceb3

Browse files
committed
Merge pull request #4067 from vanstee/allow-false-value-in-env
Allow `false` value in env passed to `System.cmd/3`
2 parents 037340c + 966c8a2 commit adaceb3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/elixir/lib/system.ex

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,8 @@ defmodule System do
493493

494494
defp validate_env(enum) do
495495
Enum.map enum, fn
496+
{k, false} ->
497+
{String.to_char_list(k), false}
496498
{k, v} ->
497499
{String.to_char_list(k), String.to_char_list(v)}
498500
other ->

lib/elixir/test/elixir/system_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ defmodule SystemTest do
7070

7171
test "cmd/3 (with options)" do
7272
assert {["hello\n"], 0} = System.cmd "echo", ["hello"],
73-
into: [], cd: System.cwd!, env: %{"foo" => "bar"},
73+
into: [], cd: System.cwd!, env: %{"foo" => "bar", "baz" => false},
7474
arg0: "echo", stderr_to_stdout: true, parallelism: true
7575
end
7676

0 commit comments

Comments
 (0)