+2
-1
README.md
+2
-1
README.md
+8
-2
lua/mise/init.lua
+8
-2
lua/mise/init.lua
···
32
local full_command = options.run .. " " .. options.args
33
local env_sh = vim.fn.system(full_command)
34
35
local ok, data = pcall(vim.json.decode, env_sh)
36
if not ok or data == nil then
37
log.error('Invalid json returned by "' .. full_command .. '"')
···
92
set_previous(data)
93
end
94
95
-
96
local group = vim.api.nvim_create_augroup("mise.nvim", { clear = true })
97
vim.api.nvim_create_autocmd("DirChanged", {
98
group = group,
···
105
})
106
107
vim.api.nvim_create_user_command("Mise", function()
108
-
log.info(vim.inspect(get_data()));
109
end, {
110
desc = "Mise",
111
})
···
32
local full_command = options.run .. " " .. options.args
33
local env_sh = vim.fn.system(full_command)
34
35
+
-- mise will print out warnings: "mise WARN" without the "--quiet" flag
36
+
if string.find(env_sh, "^mise") then
37
+
local first_line = string.match(env_sh, "^[^\n]*")
38
+
log.error(first_line)
39
+
return nil
40
+
end
41
+
42
local ok, data = pcall(vim.json.decode, env_sh)
43
if not ok or data == nil then
44
log.error('Invalid json returned by "' .. full_command .. '"')
···
99
set_previous(data)
100
end
101
102
local group = vim.api.nvim_create_augroup("mise.nvim", { clear = true })
103
vim.api.nvim_create_autocmd("DirChanged", {
104
group = group,
···
111
})
112
113
vim.api.nvim_create_user_command("Mise", function()
114
+
log.info(vim.inspect(get_data()))
115
end, {
116
desc = "Mise",
117
})