Skip to content

Commit

Permalink
fix: improved error handling in nvim-tree integration
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciech-kulik committed Feb 11, 2024
1 parent c962771 commit b925632
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lua/xcodebuild/project_manager.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,21 @@ local function run(action, params)
allParams = allParams .. " '" .. param .. "'"
end

local output = util.shell(helper .. " " .. action .. allParams)
local errorFile = "/tmp/xcodebuild_nvimtree"
local output = util.shell(helper .. " " .. action .. allParams .. " 2> " .. errorFile)

if output[#output] == "" then
table.remove(output, #output)
end

local stderr_file = io.open(errorFile, "r")
if stderr_file then
local stderr = stderr_file:read("*all")
if stderr ~= "" then
error(stderr)
end
end

return output
end

Expand Down

0 comments on commit b925632

Please sign in to comment.