mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-03-23 17:49:57 +08:00
feat(custom): add log for write_to_config function
This commit is contained in:
parent
87a1f27382
commit
4055a56a90
@ -79,8 +79,17 @@ function! s:write_to_config(config) abort
|
|||||||
let dir = expand(fnamemodify(cf, ':p:h'))
|
let dir = expand(fnamemodify(cf, ':p:h'))
|
||||||
if !isdirectory(dir)
|
if !isdirectory(dir)
|
||||||
call mkdir(dir, 'p')
|
call mkdir(dir, 'p')
|
||||||
|
let success = mkdir(dir, 'p', 0700)
|
||||||
|
if !success
|
||||||
|
call SpaceVim#logger#info('failed to create dir:' . dir)
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
let result = writefile(a:config, cf, '')
|
||||||
|
if result == -1
|
||||||
|
" failed to writefile
|
||||||
|
call SpaceVim#logger#info('failed to write config to file:' . cf)
|
||||||
endif
|
endif
|
||||||
call writefile(a:config, cf, '')
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user