We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2965047 commit 4539a9aCopy full SHA for 4539a9a
autoload/rust.vim
@@ -396,10 +396,19 @@ function! s:RmDir(path)
396
echoerr 'Attempted to delete empty path'
397
return 0
398
elseif a:path ==# '/' || a:path ==# $HOME
399
- echoerr 'Attempted to delete protected path: ' . a:path
+ let l:path = expand(a:path)
400
+ if l:path ==# '/' || l:path ==# $HOME
401
+ echoerr 'Attempted to delete protected path: ' . a:path
402
+ return 0
403
+ endif
404
405
+
406
+ if !isdirectory(a:path)
407
408
endif
- return system("rm -rf " . shellescape(a:path))
409
410
+ " delete() returns 0 when removing file successfully
411
+ return delete(a:path, 'rf') == 0
412
endfunction
413
414
" Executes {cmd} with the cwd set to {pwd}, without changing Vim's cwd.
0 commit comments