Skip to content

Add support for Environment vars in RunConfig #23

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

Merged
merged 2 commits into from
Aug 28, 2022
Merged

Conversation

gzm0
Copy link
Contributor

@gzm0 gzm0 commented Aug 28, 2022

This is the first step towards scala-js/scala-js#4686.

The functionality previously existed, but was untested.
@gzm0 gzm0 requested a review from sjrd August 28, 2022 09:06
Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was fast ^^

I have only one comment below.

Also: there's a typo in the second commit message: "Enviornment"

Comment on lines 95 to 96
def withAdditionalEnv(additionalEnv: Map[String, String]): RunConfig =
copy(additionalEnv = additionalEnv)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find it confusing that this method is called withAdditionalEnv, but it sets instead of adding. It's even more confusing that the method below actually adds to the map.

Have you considered calling it env instead of additionalEnv, hence this method would be withEnv, and the one below would remain withAdditionalEnv?

I understand the env here is in addition to the ExternalJSRun.Config.env. But that one is anyway already in addition to the host process environment vars. It doesn't seem problematic to me to keep env at each level.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have renamed it to env and removed the helper. While it might be convenient every once in a while, it is likely that at the call-site, the env is just forwarded anyways.

So it is definitely not worth the confusion.

@gzm0 gzm0 changed the title Add support for Enviornment vars in RunConfig Add support for Environment vars in RunConfig Aug 28, 2022
@gzm0 gzm0 requested a review from sjrd August 28, 2022 12:19
@sjrd sjrd merged commit f0fd30c into scala-js:main Aug 28, 2022
@sjrd
Copy link
Member

sjrd commented Aug 28, 2022

Is there anything else we should do here, or should I publish a new version now?

@gzm0 gzm0 deleted the run-env branch August 28, 2022 13:13
@gzm0
Copy link
Contributor Author

gzm0 commented Aug 28, 2022

I think the next step is to publish a new version indeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants