def after_upgrade(ctx): last_version = app.get_state_item("last_version", "0.0.0") if last_version == __version__: return if last_version == "0.0.0": app.set_state_item("last_version", __version__) else: click.secho("Please wait while upgrading PlatformIO ...", fg="yellow") clean_cache() u = Upgrader(last_version, __version__) if u.run(ctx): app.set_state_item("last_version", __version__) # update development platforms pm = PlatformManager() for manifest in pm.get_installed(): # pm.update(manifest['name'], "^" + manifest['version']) pm.update(manifest['name']) # update PlatformIO Plus tool if installed pioplus_update() click.secho( "PlatformIO has been successfully upgraded to %s!\n" % __version__, fg="green") telemetry.on_event( category="Auto", action="Upgrade", label="%s > %s" % (last_version, __version__)) else: raise exception.UpgradeError("Auto upgrading...") click.echo("") # PlatformIO banner terminal_width, _ = click.get_terminal_size() click.echo("*" * terminal_width) click.echo("If you like %s, please:" % (click.style( "PlatformIO", fg="cyan"))) click.echo("- %s us on Twitter to stay up-to-date " "on the latest project news > %s" % (click.style( "follow", fg="cyan"), click.style( "https://twitter.com/PlatformIO_Org", fg="cyan"))) click.echo("- %s it on GitHub > %s" % (click.style( "star", fg="cyan"), click.style( "https://github.com/platformio/platformio", fg="cyan"))) if not getenv("PLATFORMIO_IDE"): click.echo("- %s PlatformIO IDE for IoT development > %s" % (click.style( "try", fg="cyan"), click.style( "http://platformio.org/platformio-ide", fg="cyan"))) if not util.is_ci(): click.echo("- %s us with PlatformIO Plus > %s" % (click.style( "support", fg="cyan"), click.style( "https://pioplus.com", fg="cyan"))) click.echo("*" * terminal_width) click.echo("")
def after_upgrade(ctx): last_version = app.get_state_item("last_version", "0.0.0") if last_version == __version__: return if last_version == "0.0.0": app.set_state_item("last_version", __version__) else: click.secho("Please wait while upgrading PlatformIO ...", fg="yellow") clean_cache() u = Upgrader(last_version, __version__) if u.run(ctx): app.set_state_item("last_version", __version__) # update development platforms pm = PlatformManager() for manifest in pm.get_installed(): # pm.update(manifest['name'], "^" + manifest['version']) pm.update(manifest['name']) # update PlatformIO Plus tool if installed pioplus_update() click.secho("PlatformIO has been successfully upgraded to %s!\n" % __version__, fg="green") telemetry.on_event(category="Auto", action="Upgrade", label="%s > %s" % (last_version, __version__)) else: raise exception.UpgradeError("Auto upgrading...") click.echo("") # PlatformIO banner terminal_width, _ = click.get_terminal_size() click.echo("*" * terminal_width) click.echo("If you like %s, please:" % (click.style("PlatformIO", fg="cyan"))) click.echo("- %s us on Twitter to stay up-to-date " "on the latest project news > %s" % (click.style("follow", fg="cyan"), click.style("https://twitter.com/PlatformIO_Org", fg="cyan"))) click.echo( "- %s it on GitHub > %s" % (click.style("star", fg="cyan"), click.style("https://github.com/platformio/platformio", fg="cyan"))) if not getenv("PLATFORMIO_IDE"): click.echo( "- %s PlatformIO IDE for IoT development > %s" % (click.style("try", fg="cyan"), click.style("http://platformio.org/platformio-ide", fg="cyan"))) if not util.is_ci(): click.echo("- %s us with PlatformIO Plus > %s" % (click.style("support", fg="cyan"), click.style("https://pioplus.com", fg="cyan"))) click.echo("*" * terminal_width) click.echo("")
def cli(ctx, only_check): click.echo("Platform Manager") click.echo("================") ctx.invoke(cmd_platform_update, only_check=only_check) pioplus_update() click.echo() click.echo("Library Manager") click.echo("===============") ctx.obj = LibraryManager() ctx.invoke(cmd_lib_update, only_check=only_check)