versions() fixed mysql version (macOS), services() pid as integer
This commit is contained in:
+11
-3
@@ -492,9 +492,17 @@ function versions(callback) {
|
||||
exec('mysql -V', function (error, stdout) {
|
||||
if (!error) {
|
||||
let mysql = stdout.toString().split('\n')[0] || '';
|
||||
mysql = (mysql.toLowerCase().split(',')[0] || '').trim();
|
||||
const parts = mysql.split(' ');
|
||||
result.mysql = (parts[parts.length - 1] || '').trim();
|
||||
mysql = mysql.toLowerCase();
|
||||
if (mysql.indexOf(',') > -1) {
|
||||
mysql = (mysql.split(',')[0] || '').trim();
|
||||
const parts = mysql.split(' ');
|
||||
result.mysql = (parts[parts.length - 1] || '').trim();
|
||||
} else {
|
||||
if (mysql.indexOf(' ver ') > -1) {
|
||||
mysql = mysql.split(' ver ')[1];
|
||||
result.mysql = mysql.split(' ')[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
functionProcessed();
|
||||
});
|
||||
|
||||
+4
-1
@@ -135,7 +135,10 @@ function services(srv, callback) {
|
||||
let singleSrv = allSrv.filter(item => { return item.name === srv; });
|
||||
const pids = [];
|
||||
for (const p of ps) {
|
||||
pids.push(p.trim().split(' ')[2]);
|
||||
const pid = p.trim().split(' ')[2];
|
||||
if (pid) {
|
||||
pids.push(parseInt(pid, 10));
|
||||
}
|
||||
}
|
||||
result.push({
|
||||
name: srv,
|
||||
|
||||
Reference in New Issue
Block a user