hcy-vue-cli
Version:
An easy to use vue-cli
19 lines (16 loc) • 526 B
JavaScript
const { execa } = require("@vue/cli-shared-utils")
exports.executeCommand = function executeCommand(command, args, cwd) {
return new Promise((resolve, reject) => {
const child = execa(command, args, {
cwd,
stdio: ["inherit", "inherit", "inherit"],
})
child.on("close", (code) => {
if (code !== 0) {
reject(new Error(`command failed: ${command} ${args.join(" ")}`))
return
}
resolve()
})
})
}