Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions cmd/fastly/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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,
Expand Down
13 changes: 0 additions & 13 deletions pkg/manifest/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down