forked from platformio/platformio-core
Automatically update PIO Core packages when it is possible
This commit is contained in:
@ -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(
|
||||
|
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user