From c9f7b50d6f418849626efc69675c5cfe3f80f333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E8=B1=AA?= <504595380@qq.com> Date: Sat, 15 Jun 2024 22:12:53 +0800 Subject: [PATCH] fix: windows msys2 process.env.SHELL is an empty string --- utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils.js b/utils.js index 1dc80e3..2c5b6dd 100644 --- a/utils.js +++ b/utils.js @@ -6,7 +6,7 @@ const {spawn} = require('child_process'); // We assume that Windows provides COMSPEC env variable // and other platforms provide SHELL env variable const SHELL_PATH = process.env.SHELL || process.env.COMSPEC; -const EXECUTE_OPTION = process.env.COMSPEC !== undefined && process.env.SHELL === undefined ? '/c' : '-c'; +const EXECUTE_OPTION = process.env.COMSPEC !== undefined && !process.env.SHELL ? '/c' : '-c'; // XXX: Wrapping tos to a promise is a bit wrong abstraction. Maybe RX suits // better?