Ask user to install platform when it hasn't been installed yet

This commit is contained in:
Ivan Kravets committed 2014-12-03 20:15:52 +02:00
1 parent 61e07fe169
commit affb47b82e
3 files changed
+14 -4

No files matched your search

+4 -1
View File
@@ -59,7 +59,10 @@ def cli(environment, target, upload_port):
telemetry.on_run_environment(config.items(section), envtargets)
p = PlatformFactory().newPlatform(config.get(section, "platform"))
if (platform not in PlatformFactory.get_platforms(installed=True) and
click.confirm("The platform '%s' has not been installed yet. "
"Would you like to install it now?" % platform)):
ctx.invoke(cmd_install, platforms=[platform])
result = p.run(variables, envtargets)
secho(result['out'], fg="green")
secho(result['err'],