mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 15:38:55 +01:00
Warn if any input files to org-to-json are potentially non org-mode files
That is, if the file paths in the input set don't end with .org
This commit is contained in:
parent
3aa0c30fee
commit
d9f60c00bf
1 changed files with 5 additions and 0 deletions
|
@ -51,6 +51,11 @@ def get_org_files(org_files=None, org_file_filter=None):
|
|||
filtered_org_files = set(glob.glob(get_absolute_path(org_file_filter)))
|
||||
|
||||
all_org_files = absolute_org_files | filtered_org_files
|
||||
|
||||
files_with_non_org_extensions = {org_file for org_file in all_org_files if not org_file.endswith(".org")}
|
||||
if any(files_with_non_org_extensions):
|
||||
print(f"[Warning] There maybe non org-mode files in the input set: {files_with_non_org_extensions}")
|
||||
|
||||
if args.verbose:
|
||||
print(f'Processing files: {all_org_files}')
|
||||
|
||||
|
|
Loading…
Reference in a new issue