Solus Linux detection

This commit is contained in:
Scott E. Graves
2019-04-07 02:56:37 -05:00
parent 0e58e9fa65
commit 978e5d0415
5 changed files with 81 additions and 5 deletions

View File

@@ -156,6 +156,37 @@ module.exports.executeAsync = (command, args=[]) => {
});
};
module.exports.executeScript = script => {
return new Promise((resolve, reject) => {
const processOptions = {
detached: false,
shell: true,
windowsHide: true,
};
const command = '/bin/sh';
const args = [
script
];
const process = new spawn(command, args, processOptions);
let result = '';
process.on('error', (err) => {
reject(err);
});
process.stdout.on('data', (d)=> {
result += d;
});
process.on('exit', () => {
resolve(result);
});
process.unref();
});
};
module.exports.executeMount = (directory, version, storageType, location, noConsoleSupported, exitCallback) => {
return new Promise((resolve) => {
const processOptions = {