BundleClean cleans up unused scripts
- removes unused directories
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
com! -nargs=+ Bundle call vundle#config#bundle(<args>)
|
||||
com! -nargs=? -bang BundleInstall call vundle#installer#install("<bang>")
|
||||
com! -nargs=? BundleClean call vundle#installer#clean()
|
||||
com! -nargs=0 BundleDocs call vundle#installer#helptags()
|
||||
|
||||
com! -nargs=+ -bang BundleSearch silent call vundle#scripts#search("<bang>", <q-args>)
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user