Store specified environment in configuration for reference (#104)

This commit is contained in:
Pieter Noordhuis 2022-11-28 10:10:13 +01:00 committed by GitHub
parent 761de12a0d
commit 5c916a6fb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -10,4 +10,7 @@ type Bundle struct {
// TODO // TODO
// Default warehouse to run SQL on. // Default warehouse to run SQL on.
// DefaultWarehouse string `json:"default_warehouse,omitempty"` // DefaultWarehouse string `json:"default_warehouse,omitempty"`
// Environment is set by the mutator that selects the environment.
Environment string `json:"environment,omitempty"`
} }

View File

@ -38,6 +38,9 @@ func (m *selectEnvironment) Apply(root *config.Root) ([]Mutator, error) {
return nil, err return nil, err
} }
// Store specified environment in configuration for reference.
root.Bundle.Environment = m.name
// Clear environments after loading. // Clear environments after loading.
root.Environments = nil root.Environments = nil
return nil, nil return nil, nil