Skip to content

Commit

Permalink
Gracefully skip unexpected files
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanC committed Nov 10, 2024
1 parent 8e4200b commit fd2f448
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions salvage.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,22 @@ def GetRemoteFiles(repo: Repository) -> dict[str, dict[str, str]]:
for file in files:
logger.trace(f"{file=}")

stack: str = file.path.split("/")[1]
filepath: str = file.path
filename: str = file.name

if not filepath.startswith("stacks/"):
logger.debug(
f"Skipping remote file path {filepath} due to not being in the stacks folder"
)

continue

stack: str = file.path.split("/")[1]

results[f"{stack}/{filename}"] = {
"stack": stack,
"filename": filename,
"filepath": file.path,
"filepath": filepath,
"content": base64.b64decode(file.content).decode("UTF-8"),
"sha": file.sha,
}
Expand Down

0 comments on commit fd2f448

Please sign in to comment.