From 5bfd03a1805c46ab6e4bf9e6869715927d58e322 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 28 Sep 2022 10:40:30 +0200 Subject: [PATCH] Correctly report protocol changes in script/changes-since-last-release --- script/changes-since-last-release | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/script/changes-since-last-release b/script/changes-since-last-release index 2be7a95e11..5d0f94db12 100755 --- a/script/changes-since-last-release +++ b/script/changes-since-last-release @@ -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.