forked from platformio/platformio-core
New commands for the registry package management (pack, publish, unpublish)
This commit is contained in:
@ -17,6 +17,11 @@ PlatformIO Core 4
|
||||
- Manage organization teams
|
||||
- Manage resource access
|
||||
|
||||
* Registry Package Management
|
||||
|
||||
- Publish a personal or organization package using `platformio package publish <https://docs.platformio.org/page/core/userguide/package/cmd_publish.html>`__ command
|
||||
- Remove a pushed package from the registry using `platformio package unpublish <https://docs.platformio.org/page/core/userguide/package/cmd_unpublish.html>`__ command
|
||||
|
||||
* New `Custom Targets <https://docs.platformio.org/page/projectconf/advanced_scripting.html#custom-targets>`__
|
||||
|
||||
- Pre/Post processing based on a dependent sources (other target, source file, etc.)
|
||||
|
2
docs
2
docs
Submodule docs updated: 0da1c2810b...0ed8c2da4d
@ -25,8 +25,6 @@ from platformio import exception, fs, util
|
||||
from platformio.commands import PlatformioCLI
|
||||
from platformio.compat import dump_json_to_unicode
|
||||
from platformio.managers.lib import LibraryManager, get_builtin_libs, is_builtin_lib
|
||||
from platformio.package.manifest.parser import ManifestParserFactory
|
||||
from platformio.package.manifest.schema import ManifestSchema
|
||||
from platformio.proc import is_ci
|
||||
from platformio.project.config import ProjectConfig
|
||||
from platformio.project.exception import InvalidProjectConfError
|
||||
@ -495,24 +493,13 @@ def lib_show(library, json_output):
|
||||
return True
|
||||
|
||||
|
||||
@cli.command("register", short_help="Register a new library")
|
||||
@cli.command("register", short_help="Deprecated")
|
||||
@click.argument("config_url")
|
||||
def lib_register(config_url):
|
||||
if not config_url.startswith("http://") and not config_url.startswith("https://"):
|
||||
raise exception.InvalidLibConfURL(config_url)
|
||||
|
||||
# Validate manifest
|
||||
ManifestSchema().load_manifest(
|
||||
ManifestParserFactory.new_from_url(config_url).as_dict()
|
||||
raise exception.UserSideException(
|
||||
"This command is deprecated. Please use `pio package publish` command."
|
||||
)
|
||||
|
||||
result = util.get_api_result("/lib/register", data=dict(config_url=config_url))
|
||||
if "message" in result and result["message"]:
|
||||
click.secho(
|
||||
result["message"],
|
||||
fg="green" if "successed" in result and result["successed"] else "red",
|
||||
)
|
||||
|
||||
|
||||
@cli.command("stats", short_help="Library Registry Statistics")
|
||||
@click.option("--json-output", is_flag=True)
|
||||
|
@ -38,7 +38,12 @@ def cli():
|
||||
|
||||
|
||||
@cli.command("pack", short_help="Create a tarball from a package")
|
||||
@click.argument("package", required=True, metavar="<source directory, tar.gz or zip>")
|
||||
@click.argument(
|
||||
"package",
|
||||
required=True,
|
||||
default=os.getcwd,
|
||||
metavar="<source directory, tar.gz or zip>",
|
||||
)
|
||||
@click.option(
|
||||
"-o", "--output", help="A destination path (folder or a full path to file)"
|
||||
)
|
||||
@ -49,7 +54,12 @@ def package_pack(package, output):
|
||||
|
||||
|
||||
@cli.command("publish", short_help="Publish a package to the registry")
|
||||
@click.argument("package", required=True, metavar="<source directory, tar.gz or zip>")
|
||||
@click.argument(
|
||||
"package",
|
||||
required=True,
|
||||
default=os.getcwd,
|
||||
metavar="<source directory, tar.gz or zip>",
|
||||
)
|
||||
@click.option(
|
||||
"--owner",
|
||||
help="PIO Account username (can be organization username). "
|
||||
|
Reference in New Issue
Block a user