UNPKG

@capacitor/plugin-migration-v6-to-v7

Version:

Utility to help migrate Capacitor 6 plugins to Capacitor 7

26 lines (25 loc) 843 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.runCommand = runCommand; 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.message ? e.message : e.cause ? e.cause.toString() : 'Unknown error'; } throw e; } }