Skip to content

Commit

Permalink
feat(hurl): use global config for finding environment files
Browse files Browse the repository at this point in the history
Closed #161.
This change allows for greater flexibility and configurability, as users
can now potentially customize the function used to find environment
files by modifying the global configuration. This could be useful in
scenarios where the default method of locating environment files is not
suitable.
  • Loading branch information
jellydn committed May 23, 2024
1 parent 29af39b commit 6d40061
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lua/hurl/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ local default_config = {
height = 40,
},
env_file = { 'vars.env' },
find_env_files_in_folders = utils.find_env_files_in_folders,
formatters = {
json = { 'jq' },
html = {
Expand Down
2 changes: 1 addition & 1 deletion lua/hurl/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ local function execute_hurl_cmd(opts, callback)

-- Check vars.env exist on the current file buffer
-- Then inject the command with --variables-file vars.env
local env_files = utils.find_env_files_in_folders()
local env_files = _HURL_GLOBAL_CONFIG.find_env_files_in_folders()
for _, env in ipairs(env_files) do
utils.log_info(
'hurl: looking for ' .. vim.inspect(_HURL_GLOBAL_CONFIG.env_file) .. ' in ' .. env.path
Expand Down

0 comments on commit 6d40061

Please sign in to comment.