aboutsummaryrefslogtreecommitdiff
path: root/util.lua
diff options
context:
space:
mode:
authorMichiel van den Heuvel <michielvdnheuvel@gmail.com>2025-02-02 12:59:05 +0100
committerMichiel van den Heuvel <michielvdnheuvel@gmail.com>2025-02-02 12:59:05 +0100
commit181daa0dd954d2d30b54b1c1b78d9a6cbf7868e9 (patch)
tree394a99a8bad37a17628b7715c2117f31a8f65cb7 /util.lua
parent0f2a2a8216efbff6eea1979bc013aa9e4dce3769 (diff)
downloadvis-lspc-181daa0dd954d2d30b54b1c1b78d9a6cbf7868e9.tar.gz
vis-lspc-181daa0dd954d2d30b54b1c1b78d9a6cbf7868e9.zip
Fix find_upwards
- Use `util.vis_pipe` instead of `vis:pipe` as this does not work on the current release of vis. - Quote the path to the find-upwards script. It resides in `~/Library/Application Support` on my macOS setup, and while not very common, paths in other users' configurations might have the same issue. - At least during testing, `out` was nil in some cases. `find_upwards` checks it now.
Diffstat (limited to 'util.lua')
-rw-r--r--util.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/util.lua b/util.lua
index de5ad07..a8ca1be 100644
--- a/util.lua
+++ b/util.lua
@@ -195,9 +195,10 @@ end
-- @param globs a new line separated string of file globs
-- @param start the starting path
function util.find_upwards(globs, start)
- local status, out = vis:pipe(globs, source_path .. '/tools/find-upwards "' .. start .. '"')
+ local status, out = util.vis_pipe(globs, '\'' .. source_path:gsub('\'', '\'\\\'\'') ..
+ '/tools/find-upwards\' "' .. start .. '"')
- if status ~= 0 then
+ if status ~= 0 or out == nil then
return nil
end