Skip to content

Commit

Permalink
Show correct files with --nobuild
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Apr 28, 2024
1 parent 1b0ebaa commit 20e5c3d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion indexer/src/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ def add_files_to_version(
logging.exception(exception_msg)
raise Exception(exception_msg)

for cur in sorted(os.listdir(directory_path)):
latest_version = None
for entry in sorted(
os.scandir(directory_path), key=lambda e: e.stat().st_mtime, reverse=True
):
cur = entry.name
# skip .DS_store files
if cur.startswith("."):
continue
Expand All @@ -40,6 +44,13 @@ def add_files_to_version(
except Exception as e:
logging.exception(e)
continue
if latest_version is None:
match = file_parser.regex.match(cur)
latest_version = "mntm-" + match.group(3)
if not version.version.startswith("mntm-"):
version.version = latest_version.removeprefix("mntm-dev-")
elif latest_version not in cur:
continue
version.add_file(
VersionFile(
url=os.path.join(settings.base_url, main_dir, сhannel_dir, cur),
Expand Down

0 comments on commit 20e5c3d

Please sign in to comment.