mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-07-14 11:27:00 +08:00
Better argument handling of front-end-root
Improves handling of front-end-root launch argument. Several instances where users have set it and ComfyUI launches as normal and completely disregards the launch arg which doesn't make sense. Better to indicate to user that something is incorrect.
This commit is contained in:
parent
04cf0ccb51
commit
6a92dd1969
@ -166,13 +166,14 @@ parser.add_argument(
|
|||||||
""",
|
""",
|
||||||
)
|
)
|
||||||
|
|
||||||
def is_valid_directory(path: Optional[str]) -> Optional[str]:
|
def is_valid_directory(path: str) -> str:
|
||||||
"""Validate if the given path is a directory."""
|
"""Validate if the given path is a directory, and check permissions."""
|
||||||
if path is None:
|
if not os.path.exists(path):
|
||||||
return None
|
raise argparse.ArgumentTypeError(f"The path '{path}' does not exist.")
|
||||||
|
|
||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
raise argparse.ArgumentTypeError(f"{path} is not a valid directory.")
|
raise argparse.ArgumentTypeError(f"'{path}' is not a directory.")
|
||||||
|
if not os.access(path, os.R_OK):
|
||||||
|
raise argparse.ArgumentTypeError(f"You do not have read permissions for '{path}'.")
|
||||||
return path
|
return path
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user