-
Notifications
You must be signed in to change notification settings - Fork 586
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
[rush] Env variables for custom commands #1839
Comments
How would an environment variable help with this problem? Also, could you assign the environment variable in the script itself? What's the advantage of having Rush set up the environment? |
At build script we can handle the output based on
In this case, the output will also be restricted using `rushx', which most likely is unwanted behavior.
Other case that I can think about is testing. Using Of course, there are other ways to solve this particular problem, perhaps the output of the commands can be restricted by an additional property in `command-line.json' that can be configured. |
👍 Makes sense. @Nojukubi are you able to create a PR? |
@octogonz, all depends on chosen solution from suggests:
|
In one of the projects I'm working on, we would like to set some additional node options when running tests, but we don't want to set the options globally, and we would like to avoid updating package.json files for all projects. Just to check if I'm understanding the suggestion correctly, is the idea that we could declare something like this in command-line.json: "commands": [
{
"commandKind": "bulk",
"name": "test",
"summary": "Runs tests locally.",
"description": "Run jest for each project.",
"enableParallelism": true,
"ignoreDependencyOrder": true,
"env": {
"NODE_OPTIONS": "--unhandled-rejections=strict"
}
}, |
Hi, just checking on the status of this. Thanks. |
Is this a feature or a bug?
Please describe the actual behavior.
There is no way to predefine Env variables for the custom commands.
What is the expected behavior?
A real-life example where it can be very useful is to disable the stdout output from a large amount of simultaneous processes. Our project contains a few Vue projects that have terminal spinners, so on
rush build
the console becomes fully filled with redundant messages.Suggest to have at command-line.json possibility to specify env variables in format:
The text was updated successfully, but these errors were encountered: