You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
337 B
JavaScript
19 lines
337 B
JavaScript
4 months ago
|
const { exec } = require('child_process')
|
||
|
|
||
|
function doExec (execString, maxBuffer = 1024 ** 5) {
|
||
|
return new Promise(resolve => {
|
||
|
exec(execString, {
|
||
|
maxBuffer
|
||
|
}, err => {
|
||
|
if (err) {
|
||
|
console.error(err)
|
||
|
|
||
|
resolve(false)
|
||
|
} else {
|
||
|
resolve(true)
|
||
|
}
|
||
|
})
|
||
|
})
|
||
|
}
|
||
|
|
||
|
module.exports = doExec
|