+2
-1
README.md
+2
-1
README.md
···
17
17
Defaults
18
18
```lua
19
19
{
20
-
-- Executable to run and the args to pass
20
+
-- Executable to run
21
21
run = 'mise',
22
+
-- Args for the executable, set to "env --json --quiet" to ignore mise warnings
22
23
args = 'env --json',
23
24
-- Set to override the base PATH
24
25
initial_path = vim.env.PATH,
+8
-2
lua/mise/init.lua
+8
-2
lua/mise/init.lua
···
32
32
local full_command = options.run .. " " .. options.args
33
33
local env_sh = vim.fn.system(full_command)
34
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
+
35
42
local ok, data = pcall(vim.json.decode, env_sh)
36
43
if not ok or data == nil then
37
44
log.error('Invalid json returned by "' .. full_command .. '"')
···
92
99
set_previous(data)
93
100
end
94
101
95
-
96
102
local group = vim.api.nvim_create_augroup("mise.nvim", { clear = true })
97
103
vim.api.nvim_create_autocmd("DirChanged", {
98
104
group = group,
···
105
111
})
106
112
107
113
vim.api.nvim_create_user_command("Mise", function()
108
-
log.info(vim.inspect(get_data()));
114
+
log.info(vim.inspect(get_data()))
109
115
end, {
110
116
desc = "Mise",
111
117
})