"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.waitForProcessClose = waitForProcessClose;
exports.handleProcessError = handleProcessError;
async function waitForProcessClose(child) {
    return new Promise((resolve, reject) => {
        child.on('close', code => {
            resolve(code);
        });
        child.on('error', err => {
            reject(err);
        });
    });
}
function handleProcessError(error) {
    if (error instanceof Error) {
        console.error(`Process error: ${error.message}`);
    }
    else {
        console.error('Unknown process error:', error);
    }
    process.exit(1);
}
