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

Fix mkdir plugin, ignore error message (#2392)

This commit is contained in:
Wang Shidong 2018-12-29 23:23:53 -06:00 committed by GitHub
parent e43000775c
commit 44a8acad93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 12 deletions

View File

@ -64,12 +64,12 @@ function! s:write_to_config(config) abort
let g:_spacevim_global_config_path = global_dir . 'init.toml'
let cf = global_dir . 'init.toml'
if filereadable(cf)
call SpaceVim#logger#warn("Failed to generate config file, It is not readable: " . cf)
call SpaceVim#logger#warn('Failed to generate config file, It is not readable: ' . cf)
return
endif
let dir = expand(fnamemodify(cf, ':p:h'))
if !isdirectory(dir)
call mkdir(dir), 'p')
call mkdir(dir, 'p')
endif
call writefile(a:config, cf, '')
endfunction
@ -84,9 +84,12 @@ endfunction
function! SpaceVim#custom#apply(config, type) abort
" the type can be local or global
" local config can override global config
if type(a:config) != type({})
call SpaceVim#logger#info('config type is wrong!')
else
call SpaceVim#logger#info('start to apply config [' . a:type . ']')
let options = get(a:config, 'options', {})
for [name, value] in items(options)
exe 'let g:spacevim_' . name . ' = value'
@ -119,7 +122,8 @@ function! SpaceVim#custom#apply(config, type) abort
endfunction
function! SpaceVim#custom#write(force) abort
if a:force
endif
endfunction
function! s:path_to_fname(path) abort
@ -206,7 +210,10 @@ endfunction
" FIXME: the type should match the toml's type
function! s:opt_type(opt) abort
let var = get(g:, 'spacevim_' . a:opt, '')
" autoload/SpaceVim/custom.vim:221:31:Error: EVL103: unused argument `a:opt`
" @bugupstream viml-parser seem do not think this is used argument
let opt = a:opt
let var = get(g:, 'spacevim_' . opt, '')
if type(var) == type('')
return '[string]'
elseif type(var) == 5
@ -219,7 +226,9 @@ function! s:opt_type(opt) abort
endfunction
function! s:short_desc_of_opt(opt) abort
" TODO: add short desc for each options
if a:opt =~# '^enable_'
else
endif
return ''
endfunction

View File

@ -17,7 +17,11 @@ endfunction
fun! s:Mkdirp(dir) abort
if exists('*mkdir')
call mkdir(a:dir, 'p')
try
call mkdir(a:dir, 'p')
catch
call SpaceVim#logger#error('failed to create dir:' . a:dir)
endtry
else
" @todo mkdir only exist in *nix os
call system('mkdir -p '.shellescape(a:dir))

View File

@ -1,9 +1,14 @@
coverage:
range: 30..60
round: down
precision: 2
comment:
layout: "header, diff, changes, uncovered"
behavior: default # update if exists else create new
codecov:
branch: dev
branch: master
coverage:
status:
project:
default: false # disable the default status that measures entire project
tests: # declare a new status context "tests"
target: 100% # we always want 100% coverage here
paths: "tests/" # only include coverage in "tests/" folder
app: # declare a new status context "app"
paths: "!tests/" # remove all files in "tests/"