File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1515from toolit .create_apps_and_register import register_command
1616from types import FunctionType , ModuleType
1717from typing import Callable
18-
18+ import typer
1919
2020def get_items_from_folder (
2121 folder_path : pathlib .Path ,
@@ -56,6 +56,15 @@ def load_tools_from_folder(folder_path: pathlib.Path) -> list[FunctionType]:
5656
5757 Folder is relative to the project's working directory.
5858 """
59+ if not folder_path .exists () or not folder_path .is_dir ():
60+ msg = (
61+ "No tools loaded.\n "
62+ "The folder selected for devtools does not exist or is not a directory.\n "
63+ f"{ folder_path .absolute ().as_posix ()} \n "
64+ "Please create it and add your tools there."
65+ )
66+ typer .secho (f"\n { '=' * 60 } \n ERROR: { msg } \n { '=' * 60 } \n " , fg = typer .colors .RED , bold = True )
67+ return []
5968 # If folder_path is relative, compute its absolute path using the current working directory.
6069 if not folder_path .is_absolute ():
6170 folder_path = pathlib .Path .cwd () / folder_path
You can’t perform that action at this time.
0 commit comments