fix: Stage data.json after copying

This commit is contained in:
barkstone 2024-12-25 13:53:36 +09:00 committed by barkstone2
parent 40d4aa63a4
commit 9840b5ea8a
2 changed files with 11 additions and 0 deletions

View file

@ -182,6 +182,7 @@ export class VTBPublishManager extends Modal {
await this.fileUtils.copyTypesJson(this.noticeDuration);
await this.fileUtils.copyDataJson(this.noticeDuration);
await this.gitUtils.stageTypesJson(this.options);
await this.gitUtils.stageDataJson(this.options);
}
private reloadPublishTree = async () => {

View file

@ -185,4 +185,14 @@ export class GitUtils {
console.error(message)
}
}
async stageDataJson(options: { cwd: string }) {
try {
await git.cwd(options.cwd);
await git.add(this.paths.dataJsonDestPath());
} catch (error) {
const message = `Failed to stage data.json.\n${error.message}`;
console.error(message)
}
}
}