@@ -26177,7 +26177,7 @@ const os = __nccwpck_require__(612);
26177
26177
const https = __nccwpck_require__(2286);
26178
26178
const stream = __nccwpck_require__(6402);
26179
26179
const util = __nccwpck_require__(7261);
26180
- const { spawnSync, SpawnSyncReturns } = __nccwpck_require__(7718); // eslint-disable-line no-unused-vars
26180
+ const { spawnSync, SpawnSyncReturns, spawn, ChildProcessWithoutNullStreams } = __nccwpck_require__(7718); // eslint-disable-line no-unused-vars
26181
26181
const { getInput } = __nccwpck_require__(2186);
26182
26182
26183
26183
const platforms = ['linux', 'darwin'];
@@ -26239,6 +26239,27 @@ function checkSpawnSync(result) {
26239
26239
}
26240
26240
}
26241
26241
26242
+ /**
26243
+ * forward output from child process, crash on error
26244
+ * @param {ChildProcessWithoutNullStreams} child
26245
+ */
26246
+ async function checkSpawn(child) {
26247
+ child.stdout.pipe(process.stdout);
26248
+ child.stderr.pipe(process.stderr);
26249
+ await new Promise(function (resolve, reject) {
26250
+ child.on('close', function (code, signal) {
26251
+ if (signal != null) {
26252
+ reject(new Error(`terminated with signal ${signal}`));
26253
+ }
26254
+ if (code == 0) {
26255
+ resolve();
26256
+ } else {
26257
+ reject(new Error(`exited with code ${code}`));
26258
+ }
26259
+ });
26260
+ });
26261
+ }
26262
+
26242
26263
/**
26243
26264
* get build-id from start command
26244
26265
* @param {Buffer} stdout stdout of 'start' command
@@ -26279,7 +26300,7 @@ function parseBuildId(stdout) {
26279
26300
checkSpawnSync(spawnRet);
26280
26301
const buildId = parseBuildId(spawnRet.stdout);
26281
26302
console.log('waiting for build');
26282
- checkSpawnSync(spawnSync (cliPath, ['module', 'build', 'logs', '--id', buildId, '--wait']));
26303
+ await checkSpawn(spawn (cliPath, ['module', 'build', 'logs', '--id', buildId, '--wait']));
26283
26304
})();
26284
26305
26285
26306
})();
0 commit comments