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

Antonio Scandurra created

Change summary

script/changes-since-last-release | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

Detailed changes

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.