mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
25 lines
No EOL
446 B
JavaScript
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(); |