mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 10:40:03 +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'))
|
||||
if !isdirectory(dir)
|
||||
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
|
||||
call writefile(a:config, cf, '')
|
||||
endfunction
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user