@capacitor/plugin-migration-v5-to-v6
Version:
Utility to help migrate Capacitor 5 plugins to Capacitor 6
19 lines (18 loc) • 669 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.runCommand = void 0;
const utils_subprocess_1 = require("@ionic/utils-subprocess");
async function runCommand(command, args, options = {}) {
const p = new utils_subprocess_1.Subprocess(command, args, options);
try {
return await p.output();
}
catch (e) {
if (e instanceof utils_subprocess_1.SubprocessError) {
// old behavior of just throwing the stdout/stderr strings
throw e.output ? e.output : e.code ? e.code : e.error ? e.error.message : 'Unknown error';
}
throw e;
}
}
exports.runCommand = runCommand;