Sfoglia il codice sorgente

ci: fix canary release workflow (#11516)

David Matter 1 anno fa
parent
commit
63fd8b683a
1 ha cambiato i file con 11 aggiunte e 2 eliminazioni
  1. 11 2
      scripts/utils.js

+ 11 - 2
scripts/utils.js

@@ -95,8 +95,17 @@ export async function exec(command, args, options) {
       const ok = code === 0
       const stderr = Buffer.concat(stderrChunks).toString().trim()
       const stdout = Buffer.concat(stdoutChunks).toString().trim()
-      const result = { ok, code, stderr, stdout }
-      resolve(result)
+
+      if (ok) {
+        const result = { ok, code, stderr, stdout }
+        resolve(result)
+      } else {
+        reject(
+          new Error(
+            `Failed to execute command: ${command} ${args.join(' ')}: ${stderr}`,
+          ),
+        )
+      }
     })
   })
 }