versions() bug fix macOS
This commit is contained in:
+17
-1
@@ -367,7 +367,7 @@ function versions(callback) {
|
||||
functionProcessed();
|
||||
});
|
||||
if (_darwin) {
|
||||
const filename = '/Library/Developer/CommandLineTools/';
|
||||
let filename = '/Library/Developer/CommandLineTools/';
|
||||
fs.access(filename, fs.constants.F_OK, (err) => {
|
||||
if (!err) {
|
||||
exec('git --version', function (error, stdout) {
|
||||
@@ -378,6 +378,22 @@ function versions(callback) {
|
||||
}
|
||||
functionProcessed();
|
||||
});
|
||||
} else {
|
||||
let filename = '/usr/local/Cellar/git';
|
||||
fs.access(filename, fs.constants.F_OK, (err) => {
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user