Skip to content

Commit b98b662

Browse files
committed
Fix PlugClean when &shell is powershell on Windows (#1283)
1 parent db37a8a commit b98b662

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plug.vim

+4-1
Original file line numberDiff line numberDiff line change
@@ -2281,7 +2281,10 @@ endfunction
22812281

22822282
function! s:with_cd(cmd, dir, ...)
22832283
let script = a:0 > 0 ? a:1 : 1
2284-
return printf('cd%s %s && %s', s:is_win ? ' /d' : '', plug#shellescape(a:dir, {'script': script}), a:cmd)
2284+
let pwsh = s:is_powershell(&shell)
2285+
let cd = s:is_win && !pwsh ? 'cd /d' : 'cd'
2286+
let sep = pwsh ? ';' : '&&'
2287+
return printf('%s %s %s %s', cd, plug#shellescape(a:dir, {'script': script, 'shell': &shell}), sep, a:cmd)
22852288
endfunction
22862289

22872290
function! s:system(cmd, ...)

0 commit comments

Comments
 (0)