Automatically update PIO Core packages when it is possible

This commit is contained in:
Ivan Kravets
2017-07-31 19:38:42 +03:00
parent 06b49ec3ec
commit cd5b88dd1f
2 changed files with 7 additions and 0 deletions

View File

@ -18,11 +18,15 @@ import click
import requests
from platformio import VERSION, __version__, exception, util
from platformio.managers.core import update_core_packages
@click.command(
"upgrade", short_help="Upgrade PlatformIO to the latest version")
def cli():
# Update PlatformIO's Core packages
update_core_packages(silent=True)
latest = get_latest_version()
if __version__ == latest:
return click.secho(

View File

@ -234,6 +234,9 @@ def check_platformio_upgrade():
if (time() - interval) < last_check.get("platformio_upgrade", 0):
return
# Update PlatformIO's Core packages
update_core_packages(silent=True)
last_check['platformio_upgrade'] = int(time())
app.set_state_item("last_check", last_check)