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

13 lines
317 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);
});
});
}