aboutsummaryrefslogtreecommitdiff
path: root/vim/autoload/path.vim
blob: e230cab26e4386fe111cadfe0905ec9ea12d2427 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
" Create all the directories needed for a path, with optional flag for
" owner-only permissions
function! path#Create(name, ...) abort
  if a:0 > 2
    echoerr 'Too many arguments'
  endif
  if isdirectory(a:name)
    return 1
  endif
  let name = a:name
  let path = 'p'
  let prot = a:0 == 1 && a:1 ? 0700 : 0755
  return mkdir(name, path, prot)
endfunction