forked from platformio/platformio-core
Ask user to install platform when it hasn't been installed yet
This commit is contained in:
1 parent
61e07fe169
commit
affb47b82e
3 files changed
+14
-4
No files matched your search
@@ -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'],
|
||||
|
||||
@@ -18,7 +18,11 @@ def cli(platform):
|
||||
installed=True).keys()
|
||||
|
||||
if platform not in installed_platforms:
|
||||
raise PlatformNotInstalledYet(platform)
|
||||
if click.confirm("The platform '%s' has not been installed yet. "
|
||||
"Would you like to install it now?" % platform):
|
||||
ctx.invoke(cmd_install, platforms=[platform])
|
||||
else:
|
||||
raise PlatformNotInstalledYet(platform)
|
||||
|
||||
p = PlatformFactory().newPlatform(platform)
|
||||
echo("{name:<20} - {info}".format(name=style(p.get_name(), fg="cyan"),
|
||||
|
||||
Reference in new issue
Block a user