Skip to content
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

Add PLATFORMIO_ENV_DEFAULT environment variable #1967

Closed
Niek opened this issue Dec 11, 2018 · 4 comments

Comments

2 participants
@Niek
Copy link

commented Dec 11, 2018

There are quite a few environment variables that allow to override the platformio.ini options, but a variable for env_default is missing. It would come in handy to have a PLATFORMIO_ENV_DEFAULT (or similarly named) environment variable.

In case you're wondering why not simply use platformio run -e env, this is not always possible. For example VSCode does not allow to specify arguments in the build task (environment variables are possible).

@ivankravets ivankravets added this to the 4.0 milestone Jun 1, 2019

@ivankravets ivankravets added this to In progress in PlatformIO 4.0 Jun 1, 2019

PlatformIO 4.0 automation moved this from In progress to Done Jun 1, 2019

@ivankravets

This comment has been minimized.

Copy link
Member

commented Jun 1, 2019

Please re-test with the latest PIO Core 4.0 via $ pio upgrade --dev. Thanks!

@Niek

This comment has been minimized.

Copy link
Author

commented Jun 3, 2019

Thanks!

I tested it, and it seems to run the build for both the env_default environment as well as the one provided with the PLATFORMIO_DEFAULT_ENVS variable. Not sure if that's intended, I think it would make more sense if the environment flag would overwrite the setting in the .ini file.

@ivankravets

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

Multiple option values have "Append" behavior for sys env. If you need to replace, then use in platformIio.ini => `default_envs = ${sysenv.PLATFORMIO...}

@Niek

This comment has been minimized.

Copy link
Author

commented Jun 3, 2019

OK, got it! Works fine otherwise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.