Skip to content

Commit

Permalink
Ignore nothing to commit error
Browse files Browse the repository at this point in the history
  • Loading branch information
acoates-ms committed Mar 12, 2024
1 parent 8e07acb commit 0b52cd3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
22 changes: 18 additions & 4 deletions new-release-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,12 @@ function generateDiffs(rnwVersion, apptype) {
runCmd("git pull", wtDiffsDir);

if (!existsSync(path.resolve(wtDiffsDir, `diffs/${apptype}`))) {
mkdirSync(path.resolve(wtDiffsDir, `diffs/${apptype}`), {recursive:true});
mkdirSync(path.resolve(wtDiffsDir, `diffs/${apptype}`), {
recursive: true,
});
}

for (let existingRelease of getReleases(apptype === 'mac')) {
for (let existingRelease of getReleases(apptype === "mac")) {
console.log("processing " + existingRelease);
if (existingRelease === rnwVersion) continue;
runCmd(
Expand All @@ -168,7 +170,19 @@ function generateDiffs(rnwVersion, apptype) {
}

runCmd("git add .", wtDiffsDir);
runCmd(`git commit -m "Add release ${rnwVersion} ${apptype} diffs"`, wtDiffsDir);
try {
runCmd(
`git commit -m "Add release ${rnwVersion} ${apptype} diffs"`,
wtDiffsDir
);
} catch (e) {
console.log(
"Failure to commit diffs - If there are no changes this could indicate a previous partial run of a version update which would be ignoreable"
);
if (!e.toString().includes("nothing to commit")) {
throw e;
}
}
runCmd("git push", wtDiffsDir);
}

Expand All @@ -177,4 +191,4 @@ module.exports = {
createNewRelease,
generateDiffs,
versionAlreadyExists,
};
};
2 changes: 1 addition & 1 deletion wt-diffs
Submodule wt-diffs updated 2446 files

0 comments on commit 0b52cd3

Please sign in to comment.