Skip to content

Commit

Permalink
Ensure dependent packages for PIO Home are installed
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Dec 15, 2022
1 parent a0387bd commit 6395a03
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions platformio/home/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 6395a03

Please sign in to comment.