Skip to content

Commit

Permalink
fix: Windows 11 information (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
idranme committed Nov 1, 2023
1 parent d7db2a3 commit 5330fb2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/helpers/system.js
Expand Up @@ -38,6 +38,7 @@ module.exports = {
getOSInfo: () => {
utils.log('trace', 'getOSInfo');
let version;
let info;
if (utils.isMacOS) {
version = utils.run('sw_vers -productVersion ');
} else if (utils.isLinux) {
Expand All @@ -49,11 +50,15 @@ module.exports = {
});
} else if (utils.isWindows) {
version = Promise.resolve(os.release());
const release = os.release().split('.');
if (release[0] === '10' && release[1] === '0' && release[2] >= 22000) {
info = 'Windows 11';
}
} else {
version = Promise.resolve();
}
return version.then(v => {
let info = osName(os.platform(), os.release());
info = info || osName(os.platform(), os.release());
if (v) info += ` ${v}`;
return ['OS', info];
});
Expand Down

0 comments on commit 5330fb2

Please sign in to comment.