diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b18ec0..2cd1ac0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page. | Version | Date | Comment | | -------------- | -------------- | -------- | +| 4.33.1 | 2020-12-22 | `versions()` fixed issue (mac OS) | | 4.33.0 | 2020-12-21 | `graphics()` nvidia-smi support (linux, windows) | | 4.32.0 | 2020-12-14 | `graphics()` clinfo support (linux) | | 4.31.2 | 2020-12-14 | `graphics()` Windows 7 Graphics Fixes (Multi Monitor) | diff --git a/README.md b/README.md index 71dae5a..be2a8d5 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ [![Sponsoring][sponsor-badge]][sponsor-url] [![MIT license][license-img]][license-url] -This is amazing. Started as a small project just for myself, it now has > 10,000 lines of code, > 350 versions published, up to 2.5 mio downloads per month, > 20 mio downloads overall. Thank you to all who contributed to this project! +This is amazing. Started as a small project just for myself, it now has > 10,000 lines of code, > 350 versions published, up to 3 mio downloads per month, > 25 mio downloads overall. Thank you to all who contributed to this project! ## Upcoming diff --git a/docs/history.html b/docs/history.html index 273a256..f06d3d8 100644 --- a/docs/history.html +++ b/docs/history.html @@ -83,10 +83,15 @@ + + 4.33.1 + 2020-12-22 + versions() fixed issue (mac OS) + 4.33.0 2020-12-21 - graphics() nvidia-smi support (linux) + graphics() nvidia-smi support (linux, windows) 4.32.0 diff --git a/docs/index.html b/docs/index.html index 832f0e8..fd69132 100644 --- a/docs/index.html +++ b/docs/index.html @@ -169,7 +169,7 @@
systeminformation
-
Current Version: 4.33.0
+
Current Version: 4.33.1
diff --git a/lib/osinfo.js b/lib/osinfo.js index 5c69646..c1ffdd2 100644 --- a/lib/osinfo.js +++ b/lib/osinfo.js @@ -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) {