@nxextensions/firebase
Version:
An Nx plugin for firebase applications that would like to run the emulators in conjunction with their app
34 lines • 952 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const child_process_1 = require("child_process");
const runExecutor = async (options) => {
const commandString = createCommand(options);
let success = true;
const cp = (0, child_process_1.spawn)(commandString, {
stdio: 'inherit',
cwd: options.cwd,
shell: true,
detached: process.platform !== 'win32',
});
cp.on('exit', (code) => {
success = code === 0;
});
await waitForProcess(cp);
return {
success,
};
};
function createCommand(options) {
let commandString = 'npx firebase deploy';
if (options.only) {
commandString += ` --only ${options.only.join(',')}`;
}
return commandString;
}
async function waitForProcess(cp) {
return new Promise((res) => {
cp.on('exit', () => res());
});
}
exports.default = runExecutor;
//# sourceMappingURL=executor.js.map