versions() added postgresql
This commit is contained in:
parent
de097b5667
commit
7ae7f876d5
@ -297,11 +297,12 @@ function versions(callback) {
|
||||
nginx: '',
|
||||
php: '',
|
||||
docker: '',
|
||||
postfix: ''
|
||||
postfix: '',
|
||||
postgresql: ''
|
||||
};
|
||||
|
||||
let functionProcessed = (function () {
|
||||
let totalFunctions = 16;
|
||||
let totalFunctions = 17;
|
||||
return function () {
|
||||
if (--totalFunctions === 0) {
|
||||
if (callback) {
|
||||
@ -453,6 +454,14 @@ function versions(callback) {
|
||||
}
|
||||
functionProcessed();
|
||||
});
|
||||
exec('postgres -V', function (error, stdout) {
|
||||
if (!error) {
|
||||
const postgresql = stdout.toString().split('\n')[0].split(' ') || [];
|
||||
result.postgresql = postgresql.length ? postgresql[postgresql.length - 1] : '';
|
||||
result.mongodb = (result.mongodb.toLowerCase().split(',')[0] || '').replace(/[^0-9.]/g, '');
|
||||
}
|
||||
functionProcessed();
|
||||
});
|
||||
} catch (e) {
|
||||
if (callback) { callback(result); }
|
||||
resolve(result);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user