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

fix(issue): use systemlist instead to avoid CR LF

This commit is contained in:
wsdjeg 2023-03-31 12:30:58 +08:00
parent f4997db25d
commit d518040658

View File

@ -113,12 +113,16 @@ function! s:spacevim_version() abort
let pwd = getcwd()
try
exe 'cd ' . fnamemodify(g:_spacevim_root_dir, ':p:h')
let status = s:CMP.system('git rev-parse --short HEAD')
let status = s:CMP.systemlist('git rev-parse --short HEAD')
catch
exe 'cd ~/.SpaceVim'
let status = s:CMP.system('git rev-parse --short HEAD')
let status = s:CMP.systemlist('git rev-parse --short HEAD')
endtry
exe 'cd ' . pwd
return s:STR.trim(status)
if type(status) == 3
return s:STR.trim(join(status))
else
return ''
endif
endfunction