File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,6 @@ local env_vars = {}
1010
1111local utils = require (" rest-nvim.utils" )
1212
13- -- NOTE: vim.loop has been renamed to vim.uv in Neovim >= 0.10 and will be removed later
14- local uv = vim .uv or vim .loop
15-
1613--- Get the environment variables file filetype
1714--- @param env_file string The environment file path
1815--- @return string | nil
3128
3229--- Read the environment variables file from the rest.nvim configuration
3330--- and store all the environment variables in the `vim.env` metatable
31+ --- @param quiet boolean Whether to fail silently if an environment file is not found , defaults to ` false`
3432--- @see vim.env
35- function env_vars .read_file ()
33+ function env_vars .read_file (quiet )
34+ quiet = quiet or false
3635 local path = _G ._rest_nvim .env_file
3736 local logger = _G ._rest_nvim .logger
3837
@@ -65,8 +64,10 @@ function env_vars.read_file()
6564 vim .env [k ] = v
6665 end
6766 else
68- --- @diagnostic disable-next-line need-check-nil
69- logger :error (" Current environment file '" .. path .. " ' was not found in the current working directory" )
67+ if not quiet then
68+ --- @diagnostic disable-next-line need-check-nil
69+ logger :error (" Current environment file '" .. path .. " ' was not found in the current working directory" )
70+ end
7071 end
7172end
7273
You can’t perform that action at this time.
0 commit comments