2022-01-15 19:27:18 +01:00
|
|
|
import { exec } from 'child_process'
|
|
|
|
|
|
|
|
export default function execawait(cmd) {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
exec(cmd, (error, stdout, stderr) => {
|
|
|
|
if (error) {
|
2022-01-22 21:35:53 +01:00
|
|
|
console.warn(error)
|
2022-01-15 19:27:18 +01:00
|
|
|
}
|
2022-01-23 15:52:12 +01:00
|
|
|
resolve(stdout ? stdout : stderr)
|
2022-01-22 21:35:53 +01:00
|
|
|
})
|
|
|
|
})
|
2022-01-15 19:27:18 +01:00
|
|
|
}
|