diff --git a/cmd/fastly/main.go b/cmd/fastly/main.go index c22b49456..6c92d6800 100644 --- a/cmd/fastly/main.go +++ b/cmd/fastly/main.go @@ -63,12 +63,12 @@ func main() { } // Extract a subset of configuration options from the local application directory. - var file config.File - file.SetAutoYes(autoYes) - file.SetNonInteractive(nonInteractive) + var cfg config.File + cfg.SetAutoYes(autoYes) + cfg.SetNonInteractive(nonInteractive) // The CLI relies on a valid configuration, otherwise we can't continue. - err := file.Read(config.FilePath, in, out, fsterr.Log, verboseOutput) + err := cfg.Read(config.FilePath, in, out, fsterr.Log, verboseOutput) if err != nil { fsterr.Deduce(err).Print(color.Error) @@ -88,7 +88,7 @@ func main() { opts := app.RunOpts{ APIClient: clientFactory, Args: args, - ConfigFile: file, + ConfigFile: cfg, ConfigPath: config.FilePath, Env: env, ErrLog: fsterr.Log, diff --git a/pkg/manifest/file.go b/pkg/manifest/file.go index 6425761dc..19b3c688c 100644 --- a/pkg/manifest/file.go +++ b/pkg/manifest/file.go @@ -53,19 +53,6 @@ func (f *File) Exists() bool { return f.exists } -// Load parses the input data into the File struct and persists it to disk. -// -// NOTE: This is used by the `compute build` command logic. -// Which has to modify the toml tree for supporting a v4.0.0 migration path. -// e.g. if user manifest is missing [scripts.build] then add a default value. -func (f *File) Load(data []byte) error { - err := toml.Unmarshal(data, f) - if err != nil { - return fmt.Errorf("error unmarshaling fastly.toml: %w", err) - } - return f.Write(Filename) -} - // Read loads the manifest file content from disk. func (f *File) Read(path string) (err error) { defer func() {