Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: properly resolve environments #82

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading