diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-13 19:15:23 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-13 19:15:23 +1200 |
commit | 50c456611b35bc026ece645ff95e0aa74e73e88f (patch) | |
tree | eefc0279e85bf5f3ff959afe0fa432630f96dc4a | |
parent | Remove leading and trailing comment lines (diff) | |
download | dotfiles-50c456611b35bc026ece645ff95e0aa74e73e88f.tar.gz dotfiles-50c456611b35bc026ece645ff95e0aa74e73e88f.zip |
Refactor mkdir() call
-rw-r--r-- | vim/vimrc | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -242,10 +242,12 @@ augroup END " candidates, and specify that there must be only one argument, which we'll " provide as a quoted parameter to the function. " -function! s:Establish(path) abort - let path = expand(a:path) - if !isdirectory(path) && exists('*mkdir') - call mkdir(path, 'p', 0700) +function! s:Establish(name) abort + let name = expand(a:name) + let path = 'p' + let prot = 0700 + if !isdirectory(name) && exists('*mkdir') + call mkdir(name, path, prot) endif endfunction command! -bar -complete=dir -nargs=1 Establish |