forked from platformio/platformio-core
Deprecate "pio update", "pio lib", and "pio platform" commands
This commit is contained in:
1 parent
abf6304818
commit
92073a4ccd
5 files changed
+23
-30
No files matched your search
@@ -68,6 +68,14 @@ def get_project_global_lib_dir():
|
||||
)
|
||||
@click.pass_context
|
||||
def cli(ctx, **options):
|
||||
in_silence = PlatformioCLI.in_silence()
|
||||
if not in_silence:
|
||||
click.secho(
|
||||
"\nWARNING!!! This command is deprecated and will be removed in "
|
||||
"the next releases. \nPlease use `pio pkg` instead.\n",
|
||||
fg="yellow",
|
||||
)
|
||||
|
||||
storage_cmds = ("install", "uninstall", "update", "list")
|
||||
# skip commands that don't need storage folder
|
||||
if ctx.invoked_subcommand not in storage_cmds or (
|
||||
@@ -94,7 +102,6 @@ def cli(ctx, **options):
|
||||
get_project_dir(), get_project_global_lib_dir(), ctx.invoked_subcommand
|
||||
)
|
||||
|
||||
in_silence = PlatformioCLI.in_silence()
|
||||
ctx.meta[CTX_META_PROJECT_ENVIRONMENTS_KEY] = options["environment"]
|
||||
ctx.meta[CTX_META_INPUT_DIRS_KEY] = storage_dirs
|
||||
ctx.meta[CTX_META_STORAGE_DIRS_KEY] = []
|
||||
|
||||
@@ -18,6 +18,7 @@ import os
|
||||
|
||||
import click
|
||||
|
||||
from platformio.commands import PlatformioCLI
|
||||
from platformio.commands.boards import print_boards
|
||||
from platformio.exception import UserSideException
|
||||
from platformio.package.exception import UnknownPackageError
|
||||
@@ -30,7 +31,12 @@ from platformio.platform.factory import PlatformFactory
|
||||
|
||||
@click.group(short_help="Platform manager", hidden=True)
|
||||
def cli():
|
||||
pass
|
||||
if not PlatformioCLI.in_silence():
|
||||
click.secho(
|
||||
"\nWARNING!!! This command is deprecated and will be removed in "
|
||||
"the next releases. \nPlease use `pio pkg` instead.\n",
|
||||
fg="yellow",
|
||||
)
|
||||
|
||||
|
||||
@cli.command("search", short_help="Search for development platform")
|
||||
|
||||
@@ -14,12 +14,6 @@
|
||||
|
||||
import click
|
||||
|
||||
from platformio.commands.lib.command import CTX_META_STORAGE_DIRS_KEY
|
||||
from platformio.commands.lib.command import lib_update as cmd_lib_update
|
||||
from platformio.commands.platform import platform_update as cmd_platform_update
|
||||
from platformio.package.manager.core import update_core_packages
|
||||
from platformio.package.manager.library import LibraryPackageManager
|
||||
|
||||
|
||||
@click.command(
|
||||
"update",
|
||||
@@ -36,23 +30,9 @@ from platformio.package.manager.library import LibraryPackageManager
|
||||
@click.option(
|
||||
"--dry-run", is_flag=True, help="Do not update, only check for the new versions"
|
||||
)
|
||||
@click.pass_context
|
||||
def cli(ctx, core_packages, only_check, dry_run):
|
||||
only_check = dry_run or only_check
|
||||
|
||||
if not only_check:
|
||||
update_core_packages()
|
||||
|
||||
if core_packages:
|
||||
return
|
||||
|
||||
click.echo()
|
||||
click.echo("Platform Manager")
|
||||
click.echo("================")
|
||||
ctx.invoke(cmd_platform_update, only_check=only_check)
|
||||
|
||||
click.echo()
|
||||
click.echo("Library Manager")
|
||||
click.echo("===============")
|
||||
ctx.meta[CTX_META_STORAGE_DIRS_KEY] = [LibraryPackageManager().package_dir]
|
||||
ctx.invoke(cmd_lib_update, only_check=only_check)
|
||||
def cli(*_, **__):
|
||||
click.secho(
|
||||
"This command is deprecated and will be removed in the next releases. \n"
|
||||
"Please use `pio pkg update` instead.",
|
||||
fg="yellow",
|
||||
)
|
||||
Reference in new issue
Block a user