versions() fixed issue (mac OS)

This commit is contained in:
Sebastian Hildebrandt
2020-12-22 15:40:47 +01:00
parent 072afaebe9
commit 3887f5efef
5 changed files with 55 additions and 17 deletions
+46 -14
View File
@@ -790,24 +790,56 @@ function versions(apps, callback) {
}
}
if ({}.hasOwnProperty.call(appsObj.versions, 'pip')) {
exec('pip -V 2>&1', function (error, stdout) {
if (!error) {
const pip = stdout.toString().split('\n')[0] || '';
const parts = pip.split(' ');
appsObj.versions.pip = parts.length >= 2 ? parts[1] : '';
if (_darwin) {
const gitHomebrewExists = fs.existsSync('/usr/local/Cellar/pip');
if (util.darwinXcodeExists() || gitHomebrewExists) {
exec('pip -V 2>&1', function (error, stdout) {
if (!error) {
const pip = stdout.toString().split('\n')[0] || '';
const parts = pip.split(' ');
appsObj.versions.pip = parts.length >= 2 ? parts[1] : '';
}
functionProcessed();
});
} else {
functionProcessed();
}
functionProcessed();
});
} else {
exec('pip -V 2>&1', function (error, stdout) {
if (!error) {
const pip = stdout.toString().split('\n')[0] || '';
const parts = pip.split(' ');
appsObj.versions.pip = parts.length >= 2 ? parts[1] : '';
}
functionProcessed();
});
}
}
if ({}.hasOwnProperty.call(appsObj.versions, 'pip3')) {
exec('pip3 -V 2>&1', function (error, stdout) {
if (!error) {
const pip = stdout.toString().split('\n')[0] || '';
const parts = pip.split(' ');
appsObj.versions.pip3 = parts.length >= 2 ? parts[1] : '';
if (_darwin) {
const gitHomebrewExists = fs.existsSync('/usr/local/Cellar/pip3');
if (util.darwinXcodeExists() || gitHomebrewExists) {
exec('pip3 -V 2>&1', function (error, stdout) {
if (!error) {
const pip = stdout.toString().split('\n')[0] || '';
const parts = pip.split(' ');
appsObj.versions.pip3 = parts.length >= 2 ? parts[1] : '';
}
functionProcessed();
});
} else {
functionProcessed();
}
functionProcessed();
});
} else {
exec('pip3 -V 2>&1', function (error, stdout) {
if (!error) {
const pip = stdout.toString().split('\n')[0] || '';
const parts = pip.split(' ');
appsObj.versions.pip3 = parts.length >= 2 ? parts[1] : '';
}
functionProcessed();
});
}
}
if ({}.hasOwnProperty.call(appsObj.versions, 'java')) {
if (_darwin) {