fix(mac): avoid printing empty line to stderr on mac (#11991)

It turns out, `sw_vers` prints an empty stderr line and we inherit it.
This commit is contained in:
Dmitry Gozman 2022-02-09 15:34:10 -08:00 committed by GitHub
parent 6904b3294e
commit 1f6b84f445
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -457,7 +457,7 @@ function determineUserAgent(): string {
osIdentifier = 'windows';
osVersion = `${version[0]}.${version[1]}`;
} else if (process.platform === 'darwin') {
const version = execSync('sw_vers -productVersion').toString().trim().split('.');
const version = execSync('sw_vers -productVersion', { stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim().split('.');
osIdentifier = 'macOS';
osVersion = `${version[0]}.${version[1]}`;
} else if (process.platform === 'linux') {