Skip to content

Commit

Permalink
fix: Ensure new folders are created before renaming files
Browse files Browse the repository at this point in the history
  • Loading branch information
baumandm committed Apr 20, 2023
1 parent e23c8d3 commit 4b7a07c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/backend/src/lib/git-instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ export class GitInstance {
}

await git.remove({ fs, dir: this.localPath, filepath: originalFilePath });
await fs.ensureDir(path.dirname(path.join(this.localPath, newFilePath)));
await fs.promises.rename(path.join(this.localPath, originalFilePath), path.join(this.localPath, newFilePath));
await git.add({ fs, dir: this.localPath, filepath: newFilePath });
}
Expand Down

0 comments on commit 4b7a07c

Please # to comment.