From 5fc1a35cb50d4ed6448790d1421dcfc8d1a15614 Mon Sep 17 00:00:00 2001 From: Robin van der Noord Date: Fri, 12 Jul 2024 11:57:25 +0200 Subject: [PATCH] fix: slightly improved readable formatting for `ew mp.mounts` --- src/edwh_multipass_plugin/tasks.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/edwh_multipass_plugin/tasks.py b/src/edwh_multipass_plugin/tasks.py index 57d6e6b..e7e11aa 100644 --- a/src/edwh_multipass_plugin/tasks.py +++ b/src/edwh_multipass_plugin/tasks.py @@ -289,4 +289,10 @@ def list_mounts(c: Connection, machine: str = DEFAULT_MACHINE_NAME) -> None: config = _load_mp_config(c) mounts = get_mounts(config, machine) - print(mounts) + home = str(Path.home()) + cprint(f"Mounts for '{machine}':") + for source, target in mounts.items(): + if source.startswith(home): + source = source.replace(home, "~", 1) + + print(f" {source}: {target}")