Browse Source

replace exec with system()

- closes #64
gmarik 7 years ago
parent
commit
73daf4eb9f
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      autoload/vundle/scripts.vim

+ 3
- 2
autoload/vundle/scripts.vim View File

@@ -112,7 +112,7 @@ func! s:fetch_scripts(to)
112 112
 
113 113
   let l:vim_scripts_json = 'http://vim-scripts.org/api/scripts.json'
114 114
   if executable("curl")
115
-    silent exec '!curl --fail -s -o '.shellescape(a:to).' '.l:vim_scripts_json
115
+    let cmd = 'curl --fail -s -o '.shellescape(a:to).' '.l:vim_scripts_json
116 116
   elseif executable("wget")
117 117
     let temp = shellescape(tempname())
118 118
     let cmd = 'wget -q -O '.temp.' '.l:vim_scripts_json. ' && mv -f '.temp.' '.shellescape(a:to)
@@ -120,12 +120,13 @@ func! s:fetch_scripts(to)
120 120
       let cmd = substitute(cmd, 'mv -f ', 'mv /Y ') " change force flag
121 121
       let cmd = '"'.cmd.'"'                         " enclose in quotes so && joined cmds work
122 122
     end
123
-    silent exec '!'.cmd
124 123
   else
125 124
     echoerr 'Error curl or wget is not available!'
126 125
     return 1
127 126
   endif
128 127
 
128
+  call system(cmd)
129
+
129 130
   if (0 != v:shell_error)
130 131
     echoerr 'Error fetching scripts!'
131 132
     return v:shell_error

Loading…
Cancel
Save