mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-12 09:35:40 +08:00
feat(health): check layer health
This commit is contained in:
parent
bd505c2ac3
commit
6b354194c3
@ -22,7 +22,26 @@ function! SpaceVim#health#report() abort
|
|||||||
\ ])
|
\ ])
|
||||||
endtry
|
endtry
|
||||||
endfor
|
endfor
|
||||||
return join(report, "\n")
|
return join(report + s:check_layers(), "\n")
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! s:check_layers() abort
|
||||||
|
let report = []
|
||||||
|
for layer in SpaceVim#layers#get()
|
||||||
|
try
|
||||||
|
call extend(report, [layer . ' layer health:', ''])
|
||||||
|
let result = SpaceVim#layers#{layer}#health() ? ['ok', ''] : ['failed', '']
|
||||||
|
call extend(report,result)
|
||||||
|
catch /^Vim\%((\a\+)\)\=:E117/
|
||||||
|
call extend(report,[
|
||||||
|
\ '',
|
||||||
|
\ ' There is no function: SpaceVim#layers#' . layer . '#health()',
|
||||||
|
\ '',
|
||||||
|
\ ])
|
||||||
|
endtry
|
||||||
|
endfor
|
||||||
|
return report
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" vim:set et sw=2:
|
" vim:set et sw=2:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user