diff options
author | John Szakmeister <john@szakmeister.net> | 2014-11-25 20:03:17 -0500 |
---|---|---|
committer | John Szakmeister <john@szakmeister.net> | 2014-11-26 17:31:51 -0500 |
commit | 78618d742bf36f244880d0e55e784c555e30e60c (patch) | |
tree | 869f9e93b82d7f97acbf1a4b663b080493584ea7 | |
parent | 68fcd8b696dae33897303c9f8265629a31afbf17 (diff) | |
download | rneovim-78618d742bf36f244880d0e55e784c555e30e60c.tar.gz rneovim-78618d742bf36f244880d0e55e784c555e30e60c.tar.bz2 rneovim-78618d742bf36f244880d0e55e784c555e30e60c.zip |
Avoid printing an error response when detecting xclip.
While we're at, using the slightly more portable `command -v` technique
to detect the executable. Also, there's no need to use `io.popen()` if
we aren't going to record the path. Instead, let's use the simpler
`os.execute()` to detect the presence of xclip.
-rw-r--r-- | test/functional/shell/viml_system_spec.lua | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/test/functional/shell/viml_system_spec.lua b/test/functional/shell/viml_system_spec.lua index 84c8765b48..8d212c1375 100644 --- a/test/functional/shell/viml_system_spec.lua +++ b/test/functional/shell/viml_system_spec.lua @@ -22,11 +22,9 @@ end -- Some tests require the xclip program and a x server. local xclip = nil -do +do if os.getenv('DISPLAY') then - local proc = io.popen('which xclip') - xclip = proc:read() - proc:close() + xclip = (os.execute('command -v xclip > /dev/null 2>&1') == 0) end end |