Skip to content

Commit 0d2e24d

Browse files
canh25xpCivitasv
andauthored
feat: using correct shell chain symbol for windows powershell (#262) (#265)
* using correct chain symbol when on powershell * using correct exit_op on powershell * add missing brackets --------- Co-authored-by: HuSen <[email protected]>
1 parent be874b9 commit 0d2e24d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lua/cmake-tools/terminal.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,8 @@ local get_command_handling_on_exit = function()
539539
end
540540

541541
if osys.iswin32 then
542-
exit_op = "%errorlevel%"
543-
escape_rm = is_power_shell() and "Remove-Item " or "del /Q "
542+
exit_op = is_power_shell() and "$LASTEXITCODE" or "%errorlevel%"
543+
escape_rm = is_power_shell() and " Remove-Item " or " del /Q "
544544
exit_code_file_path = exit_code_file_path:gsub("/", "\\")
545545
lock_file_path = lock_file_path:gsub("/", "\\")
546546
end

0 commit comments

Comments
 (0)