mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 19:04:43 +00:00
24 lines
518 B
JavaScript
24 lines
518 B
JavaScript
// CURRENTLY NOT USED
|
|
|
|
const execCommand = (command) => {
|
|
const exec = require('child_process').exec;
|
|
|
|
console.info(`Running: ${command}`);
|
|
|
|
return new Promise((resolve, reject) => {
|
|
exec(command, (error, stdout) => {
|
|
if (error) {
|
|
if (error.signal === 'SIGTERM') {
|
|
resolve('Process was killed');
|
|
} else {
|
|
error.stdout = stdout;
|
|
reject(error);
|
|
}
|
|
} else {
|
|
resolve(stdout.trim());
|
|
}
|
|
});
|
|
});
|
|
};
|
|
|
|
module.exports = execCommand;
|