Skip to content

Commit

Permalink
download: Don't attempt to commit empty submodule changes
Browse files Browse the repository at this point in the history
If a previous push to submodules succeeded, but the main repo failed,
the submodules would still attempt submodule updates and fail.
  • Loading branch information
WizardCM committed Oct 5, 2024
1 parent 5369cce commit aeb7e6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,11 +418,15 @@ function pushChanges(detachedSubmodules: string[], submodules: string[]): void {
exec(`git config --global user.email '${STRINGS.git.committer.email}'`);
for (const submodule of submodules) {
process.chdir(`plugins/${submodule}`);
if (exec('git status --porcelain').length === 0) {
if (exec('git status --porcelain').trim().length === 0) {
process.chdir('../..');
continue;
}
exec('git add data/locale/*-*.ini');
if (exec('git diff --compact-summary').trim().length === 0) {
process.chdir('../..');
continue;
}
exec(`git commit -m '${STRINGS.git.commitTitle}'`);
exec('git push');
process.chdir('../..');
Expand Down

0 comments on commit aeb7e6d

Please sign in to comment.