From 6395a032e5dfb7ad444718ec0da08e0f9370f3c0 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 15 Dec 2022 20:01:28 +0200 Subject: [PATCH] Ensure dependent packages for PIO Home are installed --- platformio/home/cli.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/platformio/home/cli.py b/platformio/home/cli.py index 2d0ba1ce59..55d0959494 100644 --- a/platformio/home/cli.py +++ b/platformio/home/cli.py @@ -18,6 +18,7 @@ from platformio.home.helpers import is_port_used from platformio.home.run import run_server +from platformio.package.manager.core import get_core_package_dir @click.command("home", short_help="GUI to manage PlatformIO") @@ -48,15 +49,17 @@ ), ) def cli(port, host, no_open, shutdown_timeout, session_id): + # hook for `platformio-node-helpers` + if host == "__do_not_start__": + # download all dependent packages + get_core_package_dir("contrib-piohome") + return + # Ensure PIO Home mimetypes are known mimetypes.add_type("text/html", ".html") mimetypes.add_type("text/css", ".css") mimetypes.add_type("application/javascript", ".js") - # hook for `platformio-node-helpers` - if host == "__do_not_start__": - return - home_url = "http://%s:%d%s" % ( host, port,