DemuMesDataV/build/plugin/exec.js

19 lines
337 B
JavaScript
Raw Permalink Normal View History

2019-09-03 11:07:45 +08:00
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