Skip to content

Commit

Permalink
Fix PlugClean when &shell is powershell on Windows (#1283)
Browse files Browse the repository at this point in the history
  • Loading branch information
junegunn committed Jun 18, 2024
1 parent db37a8a commit b98b662
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plug.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2281,7 +2281,10 @@ endfunction

function! s:with_cd(cmd, dir, ...)
let script = a:0 > 0 ? a:1 : 1
return printf('cd%s %s && %s', s:is_win ? ' /d' : '', plug#shellescape(a:dir, {'script': script}), a:cmd)
let pwsh = s:is_powershell(&shell)
let cd = s:is_win && !pwsh ? 'cd /d' : 'cd'
let sep = pwsh ? ';' : '&&'
return printf('%s %s %s %s', cd, plug#shellescape(a:dir, {'script': script, 'shell': &shell}), sep, a:cmd)
endfunction

function! s:system(cmd, ...)
Expand Down

0 comments on commit b98b662

Please sign in to comment.