1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 05:57:02 +09:00
anytype-ts/electron/hook/util.js
2024-06-19 10:10:37 +02:00

25 lines
No EOL
446 B
JavaScript

const { exec } = require('child_process');
const fs = require('fs');
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();