Remove environment.Environment struct

This commit completely removes the environment struct as it is no longer
used.
This commit is contained in:
Tom Wiesing 2023-03-02 12:52:51 +01:00
parent 3263920d6b
commit 473040a69f
No known key found for this signature in database
40 changed files with 91 additions and 146 deletions

View file

@ -8,7 +8,6 @@ import (
"github.com/FAU-CDI/wisski-distillery/internal/cli"
"github.com/FAU-CDI/wisski-distillery/internal/config"
"github.com/FAU-CDI/wisski-distillery/internal/config/legacy"
"github.com/FAU-CDI/wisski-distillery/pkg/environment"
)
// ConfigMigrate is the config-migrate command
@ -31,9 +30,6 @@ func (cfgMigrate) Description() wisski_distillery.Description {
}
func (c cfgMigrate) Run(context wisski_distillery.Context) error {
// migration environment is the native environment!
var env environment.Environment
// open the legacy file
file, err := os.Open(c.Positionals.Input)
if err != nil {
@ -46,12 +42,12 @@ func (c cfgMigrate) Run(context wisski_distillery.Context) error {
var cfg config.Config
// migrate the legacy config
if err := legacy.Migrate(&cfg, env, file); err != nil {
if err := legacy.Migrate(&cfg, file); err != nil {
return err
}
// validate it!
if err := cfg.Validate(env); err != nil {
if err := cfg.Validate(); err != nil {
return err
}