Permalink
Browse files

Add cd error check

  • Loading branch information...
1 parent b1757f9 commit 4c3cec4eebf0e02cb8a04dc6ea3e8356ddb383ef @Shougo committed Jan 11, 2017
Showing with 11 additions and 2 deletions.
  1. +11 −2 autoload/dein/install.vim
@@ -640,9 +640,18 @@ endfunction
" Helper functions
function! dein#install#_cd(path) abort
- if isdirectory(a:path)
- execute (haslocaldir() ? 'lcd' : 'cd') fnameescape(a:path)
+ if !isdirectory(a:path)
+ return
endif
+
+ try
+ execute (haslocaldir() ? 'lcd' : 'cd') fnameescape(a:path)
+ catch
+ call s:error('Error cd to: ' . a:path)
+ call s:error('fnameescape(a:path): ' . fnameescape(a:path))
+ call s:error(v:exception)
+ call s:error(v:throwpoint)
+ endtry
endfunction
function! dein#install#_system(command) abort
if !dein#install#_has_job() && !has('nvim') && type(a:command) == type([])

1 comment on commit 4c3cec4

@wsdjeg
Contributor
wsdjeg commented on 4c3cec4 Jan 12, 2017

LGTM, I have test in win7

Please sign in to comment.