Allow auto-installation of platforms when prompts are disabled // Resolve #43

This commit is contained in:
Ivan Kravets committed 2014-12-29 15:10:31 +02:00
1 parent c109857707
commit 82744afe58
3 files changed
+8 -5

No files matched your search

+5 -3
View File
@@ -68,10 +68,12 @@ def process_environment(ctx, name, options, targets, upload_port):
telemetry.on_run_environment(options, envtargets)
if (app.get_setting("enable_prompts") and
platform not in PlatformFactory.get_platforms(installed=True) and
installed_platforms = PlatformFactory.get_platforms(
installed=True).keys()
if (platform not in installed_platforms and (
not app.get_setting("enable_prompts") or
click.confirm("The platform '%s' has not been installed yet. "
"Would you like to install it now?" % platform)):
"Would you like to install it now?" % platform))):
ctx.invoke(cmd_install, platforms=[platform])
p = PlatformFactory.newPlatform(platform)
+1 -1
View File
@@ -21,7 +21,7 @@ def cli(ctx, platform):
installed=True).keys()
if platform not in installed_platforms:
if (app.get_setting("enable_prompts") and
if (not app.get_setting("enable_prompts") or
click.confirm("The platform '%s' has not been installed yet. "
"Would you like to install it now?" % platform)):
ctx.invoke(cmd_install, platforms=[platform])