qwik-account-manager/libs/execawait.js
2022-01-23 15:52:12 +01:00

13 lines
313 B
JavaScript

import { exec } from 'child_process'
export default function execawait(cmd) {
return new Promise((resolve, reject) => {
exec(cmd, (error, stdout, stderr) => {
if (error) {
console.warn(error)
}
resolve(stdout ? stdout : stderr)
})
})
}