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

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

View File

@@ -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"),