1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-11 02:13:48 +09:00
anytype-ts/electron/hook/util.js
2023-08-05 13:28:58 +02:00

24 lines
No EOL
420 B
JavaScript

const { exec } = require('child_process');
class Util {
execPromise (command) {
return new Promise(function(resolve, reject) {
exec(command, (error, stdout, stderr) => {
console.log('Error: ', error, stderr);
if (error || stderr) {
reject(error || stderr);
return;
};
console.log('Out: ', stdout.trim());
resolve(stdout.trim());
});
});
};
};
module.exports = new Util();