versions() added perl, python, gcc
This commit is contained in:
+30
-2
@@ -299,11 +299,14 @@ function versions(callback) {
|
||||
php: '',
|
||||
docker: '',
|
||||
postfix: '',
|
||||
postgresql: ''
|
||||
postgresql: '',
|
||||
perl: '',
|
||||
python: '',
|
||||
gcc: ''
|
||||
};
|
||||
|
||||
let functionProcessed = (function () {
|
||||
let totalFunctions = 16;
|
||||
let totalFunctions = 19;
|
||||
return function () {
|
||||
if (--totalFunctions === 0) {
|
||||
if (callback) {
|
||||
@@ -477,6 +480,31 @@ function versions(callback) {
|
||||
functionProcessed();
|
||||
});
|
||||
}
|
||||
exec('perl -v', function (error, stdout) {
|
||||
if (!error) {
|
||||
const perl = stdout.toString().split('\n') || '';
|
||||
while (perl.length > 0 && perl[0].trim() === '') {
|
||||
perl.shift();
|
||||
}
|
||||
if (perl.length > 0) {
|
||||
result.perl = perl[0].split('(').pop().split(')')[0].replace('v', '');
|
||||
}
|
||||
}
|
||||
functionProcessed();
|
||||
});
|
||||
exec('python -V 2>&1', function (error, stdout) {
|
||||
if (!error) {
|
||||
const python = stdout.toString().split('\n')[0] || '';
|
||||
result.python = python.toLowerCase().replace('python', '').trim();
|
||||
}
|
||||
functionProcessed();
|
||||
});
|
||||
exec('gcc -dumpversion', function (error, stdout) {
|
||||
if (!error) {
|
||||
result.gcc = stdout.toString().split('\n')[0].trim() || '';
|
||||
}
|
||||
functionProcessed();
|
||||
});
|
||||
} catch (e) {
|
||||
if (callback) { callback(result); }
|
||||
resolve(result);
|
||||
|
||||
Reference in New Issue
Block a user