diff --git a/backend/library/management/commands/storelibraries.py b/backend/library/management/commands/storelibraries.py index 617c74877..1cea6c96a 100644 --- a/backend/library/management/commands/storelibraries.py +++ b/backend/library/management/commands/storelibraries.py @@ -20,9 +20,9 @@ def handle(self, *args, **options): StoredLibrary.__init_class__() path = Path(options.get("path") or LIBRARIES_PATH) if path.is_dir(): - library_files = [ + library_files = sorted( f for f in path.iterdir() if f.is_file and f.suffix == ".yaml" - ] + ) else: library_files = [path] for fname in library_files: