-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow setting environment variables and disable extending in DenoServer #82
Conversation
Okay I finally managed to add some tests. This is ready to review. |
@@ -31,6 +31,8 @@ interface ProcessRef { | |||
|
|||
interface RunOptions { | |||
pipeOutput?: boolean | |||
env?: NodeJS.ProcessEnv | |||
extendEnv?: boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what case would we set extendEnv
to true
? Or is this for backwards compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value is true
atm. I was hardcoding this at first, but then wondered if runInBackground
might be used in other scenarios in the future. Do you think I should hardcode this to false?
And because run
does the same, besides the background part I also added the options there.
Co-authored-by: Eduardo Bouças <[email protected]>
Co-authored-by: Eduardo Bouças <[email protected]>
…noServer (netlify/edge-bundler#82) * feat: allow setting environment variables and disable extending in DenoServer * chore: fix test * chore: fix tests * chore: add test * chore: debug * chore: fix tests * chore: fix tests? * Update test/bridge.ts Co-authored-by: Eduardo Bouças <[email protected]> * Update src/server/server.ts Co-authored-by: Eduardo Bouças <[email protected]> Co-authored-by: Eduardo Bouças <[email protected]>
This is a prerequisite for netlify/cli#4614.
The PR allows setting environment variables in
deno.run
anddeno.runInBackground
as well as disabling extending of current runtime environment variables. These two options basically are plainexeca
options, which are forwarded to execa.I disabled the extending of env variables in the DenoServer so that once the CLI sets the variables it will be only those available in deno. With the exception of
DENO_DIR
.DENO_DIR
is okay to have locally?