From 786dd8fe18918c8dea3c48981ec744cf77a39136 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 13 Dec 2017 01:23:18 +0200 Subject: [PATCH] Implement "--develop" option for "upgrade" command // Resolve #104 --- docs | 2 +- platformio/commands/upgrade.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs b/docs index 81346afb..a9bc3dc0 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 81346afbf88df746faf12e7dfcc4ee4504ab8829 +Subproject commit a9bc3dc0ea0766675aaeed1aaec9527012372902 diff --git a/platformio/commands/upgrade.py b/platformio/commands/upgrade.py index 9cbb6611..edff2456 100644 --- a/platformio/commands/upgrade.py +++ b/platformio/commands/upgrade.py @@ -24,12 +24,12 @@ from platformio.managers.core import update_core_packages @click.command( "upgrade", short_help="Upgrade PlatformIO to the latest version") -def cli(): +@click.option("--develop", is_flag=True, help="Force development branch") +def cli(develop): # Update PlatformIO's Core packages update_core_packages(silent=True) - latest = get_latest_version() - if __version__ == latest: + if not develop and __version__ == get_latest_version(): return click.secho( "You're up-to-date!\nPlatformIO %s is currently the " "newest version available." % __version__, @@ -40,7 +40,8 @@ def cli(): # kill all PIO Home servers, they block `pioplus` binary shutdown_servers() - to_develop = not all([c.isdigit() for c in latest if c != "."]) + to_develop = develop or not all( + [c.isdigit() for c in __version__ if c != "."]) cmds = ([ "pip", "install", "--upgrade", "https://github.com/platformio/platformio-core/archive/develop.zip"