deno icon indicating copy to clipboard operation
deno copied to clipboard

`deno compile --env` does not work

Open littledivy opened this issue 1 year ago • 1 comments

According to https://github.com/denoland/deno/commit/f8f4e776325efe0d8dd50207beecb425f0875999

This change adds the --env=[FILE] flag to the run, compile, eval, install and repl subcommands.

but running deno compile --env main.ts && ./main prints undefined:

console.log(Deno.env.get('TEST'))

The behaviour should be either:

  1. deno compile --env loads env variables from host and restores it when the binary is started.
  2. deno compile --env loads the env variables from the user when the binary is started.

I'd personally prefer 1

littledivy avatar Jan 25 '24 15:01 littledivy

We should probably do 1, but print a warning that the environment variables are being stored in the binary just to be super clear about what's going on.

dsherret avatar Jan 29 '24 14:01 dsherret

Hello @littledivy @dsherret , I'd like to investigate this issue if it has not been resolved yet....

HasanAlrimawi avatar Jun 09 '24 07:06 HasanAlrimawi

@dsherret this should probably be closed now

lino-levan avatar Jul 31 '24 16:07 lino-levan

Fixed with https://github.com/denoland/deno/pull/24166. Thanks @HasanAlrimawi

littledivy avatar Jul 31 '24 17:07 littledivy