mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-06-02 12:50:47 +00:00
14 lines
315 B
JavaScript
14 lines
315 B
JavaScript
|
import shellJs from 'shelljs';
|
||
|
|
||
|
function shellExec(cmd, silent, callback) {
|
||
|
shellJs.exec(cmd, {silent: silent}, (code, stdout, stderr) => {
|
||
|
if (code) {
|
||
|
callback(JSON.stringify({code, stdout, stderr}));
|
||
|
return;
|
||
|
}
|
||
|
callback();
|
||
|
});
|
||
|
}
|
||
|
|
||
|
export default {shellExec};
|