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