Test examples from the official dev-platforms

This commit is contained in:
Ivan Kravets
2020-12-26 21:43:41 +02:00
parent 523494f9cf
commit ce7356794d
2 changed files with 19 additions and 6 deletions

View File

@@ -26,15 +26,25 @@ import click
envvar="PIO_INSTALL_DEVPLATFORMS_IGNORE",
help="Ignore names split by comma",
)
def main(desktop, ignore):
@click.option(
"--ownernames",
envvar="PIO_INSTALL_DEVPLATFORMS_OWNERNAMES",
help="Filter dev-platforms by ownernames (split by comma)",
)
def main(desktop, ignore, ownernames):
platforms = json.loads(
subprocess.check_output(
["platformio", "platform", "search", "--json-output"]
).decode()
)
ignore = [n.strip() for n in (ignore or "").split(",") if n.strip()]
ownernames = [n.strip() for n in (ownernames or "").split(",") if n.strip()]
for platform in platforms:
skip = [not desktop and platform["forDesktop"], platform["name"] in ignore]
skip = [
not desktop and platform["forDesktop"],
platform["name"] in ignore,
ownernames and platform["ownername"] not in ownernames,
]
if any(skip):
continue
subprocess.check_call(["platformio", "platform", "install", platform["name"]])