1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-02 23:00:04 +08:00

feat(health): check layer health

This commit is contained in:
wsdjeg 2022-04-12 14:27:41 +08:00
parent bd505c2ac3
commit 6b354194c3

View File

@ -22,7 +22,26 @@ function! SpaceVim#health#report() abort
\ ])
endtry
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
" vim:set et sw=2: