Skip to content

Commit

Permalink
fix removing images
Browse files Browse the repository at this point in the history
  • Loading branch information
julesvirallinen authored and oleeskild committed Oct 2, 2023
1 parent 60a7c85 commit f94cedc
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/repositoryConnection/RepositoryConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,22 +104,17 @@ export class RepositoryConnection {
path: string,
{ branch, sha }: { branch?: string; sha?: string },
) {
if (!sha) {
logger.info(
`Getting sha for file ${path} from repository ${this.getRepositoryName()}`,
);
try {
sha ??= await this.getFile(path, branch).then((file) => file?.sha);

if (!sha) {
console.error(
`Could not get sha for file ${path} from repository ${this.getRepositoryName()}`,
`cannot find file ${path} on github, not removing`,
);

return false;
}
}

try {
const payload = {
...this.getBasePayload(),
path,
Expand Down

0 comments on commit f94cedc

Please sign in to comment.