Skip to content

Commit

Permalink
Fix incorrect method usage (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
nichita-rusin authored Jun 10, 2024
1 parent b3dedd4 commit 022adca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os from 'node:os';
import {execa} from 'execa';
import {execaSync} from 'execa';

// Reference: https://www.gaijin.at/en/lstwinver.php
// Windows 11 reference: https://docs.microsoft.com/en-us/windows/release-health/windows11-release-information
Expand Down Expand Up @@ -37,9 +37,9 @@ export default function windowsRelease(release) {
if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
let stdout;
try {
stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
stdout = execaSync('wmic', ['os', 'get', 'Caption']).stdout || '';
} catch {
stdout = execa.sync('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || '';
stdout = execaSync('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || '';
}

const year = (stdout.match(/2008|2012|2016|2019|2022/) || [])[0];
Expand Down

0 comments on commit 022adca

Please sign in to comment.