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:
Debanjum Singh Solanky 2021-08-16 13:26:49 -07:00
parent 3aa0c30fee
commit d9f60c00bf

View file

@ -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))) filtered_org_files = set(glob.glob(get_absolute_path(org_file_filter)))
all_org_files = absolute_org_files | filtered_org_files 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: if args.verbose:
print(f'Processing files: {all_org_files}') print(f'Processing files: {all_org_files}')