mirror of
https://github.com/NotAShelf/direnv.nvim.git
synced 2026-02-23 20:12:09 +00:00
handle empty exports gracefully; log in DEBUG level
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I9c9914b380cb3fd7f7b7a73cba1e19a76a6a6964
This commit is contained in:
parent
6ae5456317
commit
b07302cc27
1 changed files with 12 additions and 1 deletions
|
|
@ -237,7 +237,18 @@ M._init = function(path)
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.schedule(function()
|
vim.schedule(function()
|
||||||
local ok, env = pcall(vim.json.decode, obj.stdout)
|
local stdout = obj.stdout or ""
|
||||||
|
|
||||||
|
if stdout == "" then
|
||||||
|
-- direnv exported no changes; nothing to do
|
||||||
|
notify(
|
||||||
|
"direnv export produced no output (no changes)",
|
||||||
|
vim.log.levels.DEBUG
|
||||||
|
)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local ok, env = pcall(vim.json.decode, stdout)
|
||||||
|
|
||||||
if not ok or type(env) ~= "table" then
|
if not ok or type(env) ~= "table" then
|
||||||
notify("Failed to parse direnv JSON output", vim.log.levels.ERROR)
|
notify("Failed to parse direnv JSON output", vim.log.levels.ERROR)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue