mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Fix an issue when invalid "env_default" results into unhandled errors // Resolve #2265
This commit is contained in:
@ -8,6 +8,10 @@ PlatformIO 3.0
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Project Generator: fixed a VSCode C/C++'s "Cannot find" warning when CPPPATH folder does not exist
|
||||
* Fixed an "IndexError: list index out of range" for Arduino sketch preprocessor
|
||||
(`issue #2268 <https://github.com/platformio/platformio-core/issues/2268>`_)
|
||||
* Fixed an issue when invalid "env_default" in `"platformio.ini" (Project Configuration File) <https://docs.platformio.org/page/projectconf.html>`__ results into unhandled errors
|
||||
(`issue #2265 <https://github.com/platformio/platformio-core/issues/2265>`_)
|
||||
|
||||
3.6.6 (2019-03-29)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
@ -23,6 +23,7 @@ import click
|
||||
from platformio import exception, util
|
||||
from platformio.commands.platform import \
|
||||
platform_install as cli_platform_install
|
||||
from platformio.commands.run import check_project_envs
|
||||
from platformio.ide.projectgenerator import ProjectGenerator
|
||||
from platformio.managers.platform import PlatformManager
|
||||
|
||||
@ -130,10 +131,11 @@ def get_best_envname(project_dir, boards=None):
|
||||
config = util.load_project_config(project_dir)
|
||||
env_default = None
|
||||
if config.has_option("platformio", "env_default"):
|
||||
env_default = config.get("platformio",
|
||||
"env_default").split(", ")[0].strip()
|
||||
env_default = util.parse_conf_multi_values(
|
||||
config.get("platformio", "env_default"))
|
||||
check_project_envs(config, env_default)
|
||||
if env_default:
|
||||
return env_default
|
||||
return env_default[0]
|
||||
section = None
|
||||
for section in config.sections():
|
||||
if not section.startswith("env:"):
|
||||
|
Reference in New Issue
Block a user