mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 01:57:13 +02:00
Minor fix
This commit is contained in:
@ -77,7 +77,7 @@ def cli(ctx, environment, target, upload_port, project_dir, silent, verbose,
|
|||||||
config.get("platformio", "env_default"))
|
config.get("platformio", "env_default"))
|
||||||
|
|
||||||
check_project_defopts(config)
|
check_project_defopts(config)
|
||||||
check_project_envs(config, environment or env_default or [])
|
check_project_envs(config, environment or env_default)
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
start_time = time()
|
start_time = time()
|
||||||
@ -392,12 +392,12 @@ def check_project_defopts(config):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def check_project_envs(config, environments):
|
def check_project_envs(config, environments=None):
|
||||||
if not config.sections():
|
if not config.sections():
|
||||||
raise exception.ProjectEnvsNotAvailable()
|
raise exception.ProjectEnvsNotAvailable()
|
||||||
|
|
||||||
known = set([s[4:] for s in config.sections() if s.startswith("env:")])
|
known = set([s[4:] for s in config.sections() if s.startswith("env:")])
|
||||||
unknown = set(environments) - known
|
unknown = set(environments or []) - known
|
||||||
if unknown:
|
if unknown:
|
||||||
raise exception.UnknownEnvNames(", ".join(unknown), ", ".join(known))
|
raise exception.UnknownEnvNames(", ".join(unknown), ", ".join(known))
|
||||||
return True
|
return True
|
||||||
|
Reference in New Issue
Block a user