BundleClean cleans up unused scripts

- removes unused directories
This commit is contained in:
gmarik
2011-01-20 14:59:49 -06:00
parent 55a5ef041c
commit 75f14de912
3 changed files with 17 additions and 2 deletions

View File

@@ -42,6 +42,13 @@ func! s:install(bang, bundle)
if synced | call vundle#config#require(a:bundle) | endif
endf
func! vundle#installer#clean()
let bundle_dirs = map(copy(g:bundles), 'v:val.path()')
let all_dirs = split(globpath(g:bundle_dir, '*'), "\n")
let x_dirs = filter(all_dirs, '0 > index(bundle_dirs, v:val)')
for d in x_dirs | exec '!rm -rf "'.escape(d,'"').'"' | endfor
endf
" TODO: make it pause after output in console mode
func! s:log(msg)
if has('gui_running')