Skip to content

Commit 121c94d

Browse files
committed
add check for empty list of schema
1 parent 8d89883 commit 121c94d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

infrahub_sdk/ctl/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ def load_yamlfile_from_disk_and_exit(
187187
has_error = False
188188
try:
189189
data_files = file_type.load_from_disk(paths=paths)
190+
if not data_files:
191+
console.print("[red]No valid files found to load.")
192+
raise typer.Exit(1)
190193
except FileNotValidError as exc:
191194
console.print(f"[red]{exc.message}")
192195
raise typer.Exit(1) from exc

0 commit comments

Comments
 (0)