UNPKG

@httpc/cli

Version:

httpc cli for building function-based API with minimal code and end-to-end type safety

21 lines (20 loc) 619 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.run = void 0; const child_process_1 = require("child_process"); async function run(cmd, option) { return await new Promise((resolve, reject) => { (0, child_process_1.exec)(cmd, { ...option, }, (error, stdout, stderr) => { if (error) { console.error(error.stack); console.log('Error code: ' + error.code); reject(error); return; } resolve(); }); }); } exports.run = run;