versions() mac OS python test command line tools

This commit is contained in:
Sebastian Hildebrandt 2020-12-19 20:38:47 +01:00
parent 27b354eeb5
commit ab0b5e379f

View File

@ -739,22 +739,52 @@ function versions(apps, callback) {
}); });
} }
if ({}.hasOwnProperty.call(appsObj.versions, 'python')) { if ({}.hasOwnProperty.call(appsObj.versions, 'python')) {
exec('python -V 2>&1', function (error, stdout) { if (_darwin) {
if (!error) { const gitHomebrewExists = fs.existsSync('/usr/local/Cellar/python');
const python = stdout.toString().split('\n')[0] || ''; if (util.darwinXcodeExists() || gitHomebrewExists) {
appsObj.versions.python = python.toLowerCase().replace('python', '').trim(); exec('python -V 2>&1', function (error, stdout) {
if (!error) {
const python = stdout.toString().split('\n')[0] || '';
appsObj.versions.python = python.toLowerCase().replace('python', '').trim();
}
functionProcessed();
});
} else {
functionProcessed();
} }
functionProcessed(); } else {
}); exec('python -V 2>&1', function (error, stdout) {
if (!error) {
const python = stdout.toString().split('\n')[0] || '';
appsObj.versions.python = python.toLowerCase().replace('python', '').trim();
}
functionProcessed();
});
}
} }
if ({}.hasOwnProperty.call(appsObj.versions, 'python3')) { if ({}.hasOwnProperty.call(appsObj.versions, 'python3')) {
exec('python3 -V 2>&1', function (error, stdout) { if (_darwin) {
if (!error) { const gitHomebrewExists = fs.existsSync('/usr/local/Cellar/python3');
const python = stdout.toString().split('\n')[0] || ''; if (util.darwinXcodeExists() || gitHomebrewExists) {
appsObj.versions.python3 = python.toLowerCase().replace('python', '').trim(); exec('python3 -V 2>&1', function (error, stdout) {
if (!error) {
const python = stdout.toString().split('\n')[0] || '';
appsObj.versions.python3 = python.toLowerCase().replace('python', '').trim();
}
functionProcessed();
});
} else {
functionProcessed();
} }
functionProcessed(); } else {
}); exec('python3 -V 2>&1', function (error, stdout) {
if (!error) {
const python = stdout.toString().split('\n')[0] || '';
appsObj.versions.python3 = python.toLowerCase().replace('python', '').trim();
}
functionProcessed();
});
}
} }
if ({}.hasOwnProperty.call(appsObj.versions, 'pip')) { if ({}.hasOwnProperty.call(appsObj.versions, 'pip')) {
exec('pip -V 2>&1', function (error, stdout) { exec('pip -V 2>&1', function (error, stdout) {