This commit allows empty values for env vars in order to make the behavior consistent with the normal command execution.
Suppose we set an env var called FOO with export FOO= (note this is an empty), and we have a simple script that prints this env var:
console.log(`Foo: ${Deno.env.get("FOO")}`);
Running this script via deno run gets us Foo:.
While via deno task (with "foo": "deno run --allow-env foo.ts" in deno.json) it gets us Foo: undefined.
This might be a significant difference if it matters whether the env var is set or not. So this PR fixes this behavior by always setting given env vars even if they are empty.
I'm not really sure if there's a place where I can write a test case. Please let me know if there should be a test case.
This commit allows empty values for env vars in order to make the behavior consistent with the normal command execution.
Suppose we set an env var called FOO with
export FOO=
(note this is an empty), and we have a simple script that prints this env var:Running this script via
deno run
gets usFoo:
. While viadeno task
(with "foo": "deno run --allow-env foo.ts" in deno.json) it gets usFoo: undefined
. This might be a significant difference if it matters whether the env var is set or not. So this PR fixes this behavior by always setting given env vars even if they are empty.I'm not really sure if there's a place where I can write a test case. Please let me know if there should be a test case.