mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
Replace "--only-check" CLI option by "--dry-run"
This commit is contained in:
@ -18,6 +18,7 @@ PlatformIO 4.0
|
|||||||
* Override default source and include directories for a library via `library.json <http://docs.platformio.org/page/librarymanager/config.html>`__ manifest using ``includeDir`` and ``srcDir`` fields
|
* Override default source and include directories for a library via `library.json <http://docs.platformio.org/page/librarymanager/config.html>`__ manifest using ``includeDir`` and ``srcDir`` fields
|
||||||
* Added support for the latest Python "Click" package (CLI Builder)
|
* Added support for the latest Python "Click" package (CLI Builder)
|
||||||
(`issue #349 <https://github.com/platformio/platformio-core/issues/349>`_)
|
(`issue #349 <https://github.com/platformio/platformio-core/issues/349>`_)
|
||||||
|
* Deprecated ``--only-check`` CLI option for "update" sub-commands, please use ``--dry-run`` instead
|
||||||
|
|
||||||
PlatformIO 3.0
|
PlatformIO 3.0
|
||||||
--------------
|
--------------
|
||||||
|
2
docs
2
docs
Submodule docs updated: 700a8ac467...6e0004755a
@ -123,13 +123,19 @@ def lib_uninstall(lm, libraries):
|
|||||||
"-c",
|
"-c",
|
||||||
"--only-check",
|
"--only-check",
|
||||||
is_flag=True,
|
is_flag=True,
|
||||||
help="Do not update, only check for new version")
|
help="DEPRECATED. Please use `--dry-run` instead")
|
||||||
|
@click.option(
|
||||||
|
"--dry-run",
|
||||||
|
is_flag=True,
|
||||||
|
help="Do not update, only check for the new versions")
|
||||||
@click.option("--json-output", is_flag=True)
|
@click.option("--json-output", is_flag=True)
|
||||||
@click.pass_obj
|
@click.pass_obj
|
||||||
def lib_update(lm, libraries, only_check, json_output):
|
def lib_update(lm, libraries, only_check, dry_run, json_output):
|
||||||
if not libraries:
|
if not libraries:
|
||||||
libraries = [manifest['__pkg_dir'] for manifest in lm.get_installed()]
|
libraries = [manifest['__pkg_dir'] for manifest in lm.get_installed()]
|
||||||
|
|
||||||
|
only_check = dry_run or only_check
|
||||||
|
|
||||||
if only_check and json_output:
|
if only_check and json_output:
|
||||||
result = []
|
result = []
|
||||||
for library in libraries:
|
for library in libraries:
|
||||||
|
@ -329,9 +329,14 @@ def platform_uninstall(platforms):
|
|||||||
"-c",
|
"-c",
|
||||||
"--only-check",
|
"--only-check",
|
||||||
is_flag=True,
|
is_flag=True,
|
||||||
help="Do not update, only check for a new version")
|
help="DEPRECATED. Please use `--dry-run` instead")
|
||||||
|
@click.option(
|
||||||
|
"--dry-run",
|
||||||
|
is_flag=True,
|
||||||
|
help="Do not update, only check for the new versions")
|
||||||
@click.option("--json-output", is_flag=True)
|
@click.option("--json-output", is_flag=True)
|
||||||
def platform_update(platforms, only_packages, only_check, json_output):
|
def platform_update(platforms, only_packages, only_check, dry_run,
|
||||||
|
json_output):
|
||||||
pm = PlatformManager()
|
pm = PlatformManager()
|
||||||
pkg_dir_to_name = {}
|
pkg_dir_to_name = {}
|
||||||
if not platforms:
|
if not platforms:
|
||||||
@ -341,6 +346,8 @@ def platform_update(platforms, only_packages, only_check, json_output):
|
|||||||
pkg_dir_to_name[manifest['__pkg_dir']] = manifest.get(
|
pkg_dir_to_name[manifest['__pkg_dir']] = manifest.get(
|
||||||
"title", manifest['name'])
|
"title", manifest['name'])
|
||||||
|
|
||||||
|
only_check = dry_run or only_check
|
||||||
|
|
||||||
if only_check and json_output:
|
if only_check and json_output:
|
||||||
result = []
|
result = []
|
||||||
for platform in platforms:
|
for platform in platforms:
|
||||||
|
@ -68,8 +68,12 @@ def remote_agent_list():
|
|||||||
"-c",
|
"-c",
|
||||||
"--only-check",
|
"--only-check",
|
||||||
is_flag=True,
|
is_flag=True,
|
||||||
help="Do not update, only check for new version")
|
help="DEPRECATED. Please use `--dry-run` instead")
|
||||||
def remote_update(only_check):
|
@click.option(
|
||||||
|
"--dry-run",
|
||||||
|
is_flag=True,
|
||||||
|
help="Do not update, only check for the new versions")
|
||||||
|
def remote_update(only_check, dry_run):
|
||||||
pioplus_call(sys.argv[1:])
|
pioplus_call(sys.argv[1:])
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,12 +29,19 @@ from platformio.managers.lib import LibraryManager
|
|||||||
"-c",
|
"-c",
|
||||||
"--only-check",
|
"--only-check",
|
||||||
is_flag=True,
|
is_flag=True,
|
||||||
help="Do not update, only check for new version")
|
help="DEPRECATED. Please use `--dry-run` instead")
|
||||||
|
@click.option(
|
||||||
|
"--dry-run",
|
||||||
|
is_flag=True,
|
||||||
|
help="Do not update, only check for the new versions")
|
||||||
|
@click.option("--json-output", is_flag=True)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def cli(ctx, core_packages, only_check):
|
def cli(ctx, core_packages, only_check, dry_run):
|
||||||
# cleanup lib search results, cached board and platform lists
|
# cleanup lib search results, cached board and platform lists
|
||||||
app.clean_cache()
|
app.clean_cache()
|
||||||
|
|
||||||
|
only_check = dry_run or only_check
|
||||||
|
|
||||||
update_core_packages(only_check)
|
update_core_packages(only_check)
|
||||||
|
|
||||||
if core_packages:
|
if core_packages:
|
||||||
|
@ -329,7 +329,7 @@ def check_internal_updates(ctx, what):
|
|||||||
fg="yellow",
|
fg="yellow",
|
||||||
nl=False)
|
nl=False)
|
||||||
click.secho(
|
click.secho(
|
||||||
"`platformio %s update --only-check`" %
|
"`platformio %s update --dry-run`" %
|
||||||
("lib --global" if what == "libraries" else "platform"),
|
("lib --global" if what == "libraries" else "platform"),
|
||||||
fg="cyan",
|
fg="cyan",
|
||||||
nl=False)
|
nl=False)
|
||||||
|
Reference in New Issue
Block a user