Solus Linux detection
This commit is contained in:
31
helpers.js
31
helpers.js
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user