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

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

View File

@@ -15,7 +15,8 @@ Release History
*MCUs* (`issue #35 <https://github.com/ivankravets/platformio/issues/35>`_)
* Automatic detection of port on `platformio serialports monitor <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`_
(`issue #37 <https://github.com/ivankravets/platformio/issues/37>`_)
* Fixed urllib3's *SSL* warning under Python <= 2.7.2 (`issue #39 <https://github.com/ivankravets/platformio/issues/39>`_)
* Allowed auto-installation of platforms when prompts are disabled (`issue #43 <https://github.com/ivankravets/platformio/issues/43>`_)
* Fixed urllib3's *SSL* warning under Python <= 2.7.2 (`issue #39 <https://github.com/ivankravets/platformio/issues/39>`_)
* Fixed bug with *Arduino USB* boards (`issue #40 <https://github.com/ivankravets/platformio/issues/40>`_)
0.9.2 (2014-12-10)

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)

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])