From 0dfa151b024da1a32cf88bcc2e11f5399132a967 Mon Sep 17 00:00:00 2001 From: Sander Declerck Date: Thu, 5 Feb 2026 10:45:45 +0100 Subject: [PATCH] Fix linting --- .../safe-chain/src/shell-integration/helpers.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/safe-chain/src/shell-integration/helpers.js b/packages/safe-chain/src/shell-integration/helpers.js index 23380db..8f1450d 100644 --- a/packages/safe-chain/src/shell-integration/helpers.js +++ b/packages/safe-chain/src/shell-integration/helpers.js @@ -258,11 +258,10 @@ export async function validatePowerShellExecutionPolicy(shellExecutableName) { } try { - const spawnOptions = {}; - // For Windows PowerShell (5.1), clean PSModulePath to avoid conflicts with PowerShell 7 modules // When PowerShell 7 is installed, it adds its module paths to PSModulePath, causing // Windows PowerShell to try loading incompatible PowerShell 7 modules (TypeData conflicts) + let spawnOptions; if (shellExecutableName === "powershell") { const userProfile = process.env.USERPROFILE || ""; const cleanPSModulePath = [ @@ -271,10 +270,14 @@ export async function validatePowerShellExecutionPolicy(shellExecutableName) { "C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules", ].join(";"); - spawnOptions.env = { - ...process.env, - PSModulePath: cleanPSModulePath, + spawnOptions = { + env: { + ...process.env, + PSModulePath: cleanPSModulePath, + }, }; + } else { + spawnOptions = {}; } const commandResult = await safeSpawn(