From 9768de8bf2b52cfb3f4a17cf0b551c7f752da0dc Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Fri, 19 Apr 2024 19:28:15 +0100 Subject: [PATCH] feat(env): List possible config path locations when not found --- devine/commands/env.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/devine/commands/env.py b/devine/commands/env.py index 0258045..24ffbac 100644 --- a/devine/commands/env.py +++ b/devine/commands/env.py @@ -5,8 +5,9 @@ import click from rich.padding import Padding from rich.table import Table +from rich.tree import Tree -from devine.core.config import config, config_path +from devine.core.config import POSSIBLE_CONFIG_PATHS, config, config_path from devine.core.console import console from devine.core.constants import context_settings from devine.core.services import Services @@ -25,7 +26,13 @@ def info() -> None: if config_path: log.info(f"Config loaded from {config_path}") else: - log.info("No config file found...") + tree = Tree("No config file found, you can use any of the following locations:") + for i, path in enumerate(POSSIBLE_CONFIG_PATHS, start=1): + tree.add(f"[repr.number]{i}.[/] [text2]{path.resolve()}[/]") + console.print(Padding( + tree, + (0, 5) + )) table = Table(title="Directories", expand=True) table.add_column("Name", no_wrap=True)