Skip to content

Commit

Permalink
Merge pull request #82 from adalessa/fix/environment
Browse files Browse the repository at this point in the history
fix: properly resolve environments
  • Loading branch information
adalessa authored Mar 13, 2024
2 parents 5ef5296 + 7892946 commit ef57e6a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions lua/laravel/environment/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ local function resolve()
local opts = config.options.environments

if opts.env_variable then
local env = find_env_by_name(get_env(opts.env_variable), opts.definitions)
if env then
return env
local env_opts = find_env_by_name(get_env(opts.env_variable), opts.definitions)
if env_opts then
local env = Environment:new(env_opts)
if env:check() then
return env
end
end
end

Expand All @@ -44,9 +47,12 @@ local function resolve()
end

if opts.default then
local env = find_env_by_name(opts.default, opts.definitions)
if env then
return env
local env_opts = find_env_by_name(opts.default, opts.definitions)
if env_opts then
local env = Environment:new(env_opts)
if env:check() then
return env
end
end
end

Expand Down

0 comments on commit ef57e6a

Please sign in to comment.