versions() bug fix macOS detection
This commit is contained in:
parent
866ca78a7f
commit
02e527f808
@ -100,6 +100,7 @@ Other changes
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
|
| 3.52.7 | 2018-12-29 | `versions()` bug fix macOS detection |
|
||||||
| 3.52.6 | 2018-12-28 | `versions()` bug fix macOS |
|
| 3.52.6 | 2018-12-28 | `versions()` bug fix macOS |
|
||||||
| 3.52.5 | 2018-12-28 | preparing automated tests, travis-ci integration, added dev-dependencies |
|
| 3.52.5 | 2018-12-28 | preparing automated tests, travis-ci integration, added dev-dependencies |
|
||||||
| 3.52.4 | 2018-12-27 | `graphics().controllers` bugfix linux |
|
| 3.52.4 | 2018-12-27 | `graphics().controllers` bugfix linux |
|
||||||
|
|||||||
@ -42,8 +42,6 @@ Lightweight collection of 35+ functions to retrieve detailed hardware, system an
|
|||||||
$ npm install systeminformation --save
|
$ npm install systeminformation --save
|
||||||
```
|
```
|
||||||
|
|
||||||
For production builds (to prevent installing `dev-dependencies`) be sure to set `NODE_ENV` environment variable to `production` befor running `npm install`
|
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
All functions (except `version` and `time`) are implemented as asynchronous functions. Here a small example how to use them:
|
All functions (except `version` and `time`) are implemented as asynchronous functions. Here a small example how to use them:
|
||||||
|
|||||||
@ -367,35 +367,21 @@ function versions(callback) {
|
|||||||
functionProcessed();
|
functionProcessed();
|
||||||
});
|
});
|
||||||
if (_darwin) {
|
if (_darwin) {
|
||||||
let filename = '/Library/Developer/CommandLineTools/';
|
const cmdLineToolsExists = fs.existsSync('/Library/Developer/CommandLineTools/');
|
||||||
fs.access(filename, fs.constants.F_OK, (err) => {
|
const xcodeExists = fs.existsSync('/Library/Developer/Xcode/');
|
||||||
if (!err) {
|
const gitHomebrewExists = fs.existsSync('/usr/local/Cellar/git');
|
||||||
exec('git --version', function (error, stdout) {
|
if (cmdLineToolsExists || xcodeExists || gitHomebrewExists) {
|
||||||
if (!error) {
|
exec('git --version', function (error, stdout) {
|
||||||
let git = stdout.toString().split('\n')[0] || '';
|
if (!error) {
|
||||||
git = (git.toLowerCase().split('version')[1] || '').trim();
|
let git = stdout.toString().split('\n')[0] || '';
|
||||||
result.git = (git.split(' ')[0] || '').trim();
|
git = (git.toLowerCase().split('version')[1] || '').trim();
|
||||||
}
|
result.git = (git.split(' ')[0] || '').trim();
|
||||||
functionProcessed();
|
}
|
||||||
});
|
functionProcessed();
|
||||||
} else {
|
});
|
||||||
let filename = '/usr/local/Cellar/git';
|
} else {
|
||||||
fs.access(filename, fs.constants.F_OK, (err) => {
|
functionProcessed();
|
||||||
if (!err) {
|
}
|
||||||
exec('git --version', function (error, stdout) {
|
|
||||||
if (!error) {
|
|
||||||
let git = stdout.toString().split('\n')[0] || '';
|
|
||||||
git = (git.toLowerCase().split('version')[1] || '').trim();
|
|
||||||
result.git = (git.split(' ')[0] || '').trim();
|
|
||||||
}
|
|
||||||
functionProcessed();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
functionProcessed();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
exec('git --version', function (error, stdout) {
|
exec('git --version', function (error, stdout) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user