From 022adcad587ac73f4c3d9ec9609b7401058cda9c Mon Sep 17 00:00:00 2001 From: nichita-rusin <116542109+nichita-rusin@users.noreply.github.com> Date: Mon, 10 Jun 2024 16:16:16 +0300 Subject: [PATCH] Fix incorrect method usage (#34) --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 5e65b54..51d6763 100644 --- a/index.js +++ b/index.js @@ -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 @@ -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];