From 555703d3934b6aa14c82c88a0bde0e68edb74c05 Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Wed, 30 Mar 2011 00:36:16 -0600 Subject: [PATCH] Fix error if directory already exists on windows --- autoload/vundle/scripts.vim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 8e48d8c..85ae6f2 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -41,9 +41,12 @@ endf func! s:fetch_scripts(to) let temp = tempname() if has('win32') || has('win64') - let d = fnamemodify(expand(a:to), ":h") + let scripts_dir = fnamemodify(expand(a:to), ":h") + if !isdirectory(scripts_dir) + call mkdir(scripts_dir, "p") + endif exec '!curl http://vim-scripts.org/api/scripts.json > '.temp. - \ '&& mkdir '.d.' && move /Y '.temp.' '.a:to + \ '&& move /Y '.temp.' '.a:to else exec '!curl http://vim-scripts.org/api/scripts.json > '.temp. \ '&& mkdir -p $(dirname '.a:to.') && mv -f '.temp.' '.a:to