From c678b861dc3907432a2f79ce3acf778940f7006b Mon Sep 17 00:00:00 2001 From: robi-wan Date: Sun, 29 Apr 2012 23:59:55 +0300 Subject: [PATCH] fix Changelog after BundleInstall! on windows - add /d switch to cd command to perform drive change - enclose joined commands with quotes --- autoload/vundle/scripts.vim | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/autoload/vundle/scripts.vim b/autoload/vundle/scripts.vim index 0766033..a7ef724 100644 --- a/autoload/vundle/scripts.vim +++ b/autoload/vundle/scripts.vim @@ -39,9 +39,17 @@ func! s:create_changelog() abort let updated_sha = bundle_data[1] let bundle = bundle_data[2] - let updates = system('cd '.shellescape(bundle.path()). + let cmd = 'cd '.shellescape(bundle.path()). \ ' && git log --pretty=format:"%s %an, %ar" --graph '. - \ initial_sha.'..'.updated_sha) + \ initial_sha.'..'.updated_sha + + if (has('win32') || has('win64')) + let cmd = substitute(cmd, '^cd ','cd /d ','') " add /d switch to change drives + let cmd = '"'.cmd.'"' " enclose in quotes + endif + + let updates = system(cmd) + call add(g:vundle_changelog, '') call add(g:vundle_changelog, 'Updated Bundle: '.bundle.name)