Skip to content

Commit d0e682a

Browse files
committed
Don't check existence of temporary files, just try to read them
1 parent dd28844 commit d0e682a

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

autoload/xolox/shell.vim

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" Vim auto-load script
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: June 14, 2011
3+
" Last Change: June 17, 2011
44
" URL: http://peterodding.com/code/vim/shell/
55

66
if !exists('s:script')
@@ -108,8 +108,8 @@ function! xolox#shell#execute(command, synchronous, ...) " -- execute external c
108108
let cmd = &shell . ' ' . &shellcmdflag . ' ' . cmd
109109
let error = s:library_call(fn, cmd)
110110
if error != ''
111-
let msg = '%s: %s(%s) failed! (error: %s)'
112-
throw printf(msg, s:script, fn, strtrans(cmd), strtrans(error))
111+
let msg = '%s(%s) failed! (error: %s)'
112+
throw printf(msg, fn, strtrans(cmd), strtrans(error))
113113
endif
114114
else
115115
if has('unix') && !a:synchronous
@@ -118,11 +118,12 @@ function! xolox#shell#execute(command, synchronous, ...) " -- execute external c
118118
call s:handle_error(cmd, system(cmd))
119119
endif
120120
if a:synchronous
121-
if !filereadable(tempout)
122-
let msg = '%s: Failed to execute %s!'
123-
throw printf(msg, s:script, strtrans(cmd))
124-
endif
125-
return readfile(tempout)
121+
try
122+
return readfile(tempout)
123+
catch
124+
let msg = 'Failed to get output of command "%s"!'
125+
throw printf(msg, strtrans(cmd))
126+
endtry
126127
else
127128
return 1
128129
endif

plugin/shell.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
" Vim plug-in
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: June 14, 2011
3+
" Last Change: June 17, 2011
44
" URL: http://peterodding.com/code/vim/shell/
55
" License: MIT
6-
" Version: 0.9.4
6+
" Version: 0.9.5
77

88
" Support for automatic update using the GLVS plug-in.
99
" GetLatestVimScripts: 3123 1 :AutoInstall: shell.zip

0 commit comments

Comments
 (0)