From 4868d7c3e71b8548b6aca603ba5f238c7e5bb159 Mon Sep 17 00:00:00 2001 From: Anton Medvedev Date: Tue, 28 Feb 2023 20:55:36 +0100 Subject: [PATCH] Do not throw on win which --- src/core.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core.ts b/src/core.ts index 8169b0830b..062ef35900 100644 --- a/src/core.ts +++ b/src/core.ts @@ -80,8 +80,12 @@ try { defaults.quote = quote } catch (err) { if (process.platform == 'win32') { - defaults.shell = which.sync('powershell.exe') - defaults.quote = quotePowerShell + try { + defaults.shell = which.sync('powershell.exe') + defaults.quote = quotePowerShell + } catch (err) { + // no powershell? + } } }