Correctly report protocol changes in script/changes-since-last-release

This commit is contained in:
Antonio Scandurra 2022-09-28 10:40:30 +02:00
parent 500ff131db
commit 5bfd03a180

View file

@ -20,13 +20,17 @@ async function main() {
// Print the previous release
console.log(`Changes from ${oldTag} to ${newTag}\n`);
const hasProtocolChanges =
execFileSync("git", ["diff", oldTag, newTag, "--", "crates/rpc"]).status != 0;
let hasProtocolChanges = false;
try {
execFileSync("git", ["diff", oldTag, newTag, "--exit-code", "--", "crates/rpc"]).status != 0;
} catch (error) {
hasProtocolChanges = true;
}
if (hasProtocolChanges) {
console.log("No RPC protocol changes\n");
console.warn("\033[31;1;4mRPC protocol changes, server should be re-deployed\033[0m\n");
} else {
console.warn("RPC protocol changes\n");
console.log("No RPC protocol changes\n");
}
// Get the PRs merged between those two tags.