From 5ce2a23d1b91c6e240adc18afbffbf4a024e5f59 Mon Sep 17 00:00:00 2001 From: Anjan Nath Date: Fri, 4 Mar 2022 20:05:05 +0530 Subject: [PATCH] use crc instead of absolute path to crc --- src/main.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main.ts b/src/main.ts index 64f286b..9501c78 100644 --- a/src/main.ts +++ b/src/main.ts @@ -458,11 +458,14 @@ const prepareDevTerminalForPreset = async function(preset: DevTerminalType) { default: return false } - //TODO: use iterm or iterm2 for macOS + if (isWin) { var poshPath = which.sync("powershell.exe", { nothrow: true }) + + //TODO: use absolute path for crc binary + var cmd = `-NoExit -Command "&{crc ${command} | Invoke-Expression}"` if (poshPath !== null) { - const posh = childProcess.spawn(poshPath, [`-NoExit -command "&'${crcBinary()} ${command} | Invoke-Expression'"`], { + const posh = childProcess.spawn(poshPath, [cmd], { detached: true, shell: true, cwd: os.homedir(),