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
5 changes: 5 additions & 0 deletions internal/devconfig/configfile/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ func (c *ConfigFile) SaveTo(path string) error {
return os.WriteFile(filepath.Join(path, DefaultName), c.Bytes(), 0o644)
}

// TODO: Can we remove SaveTo and just use Save()?
func (c *ConfigFile) Save() error {
return c.SaveTo(c.AbsRootPath)
}

// Get returns the package with the given versionedName
func (c *ConfigFile) GetPackage(versionedName string) (*Package, bool) {
name, version := parseVersionedName(versionedName)
Expand Down
6 changes: 5 additions & 1 deletion pkg/autodetect/autodetect.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ func InitConfig(ctx context.Context, path string) error {
return err
}

return populateConfig(ctx, path, config)
if err = populateConfig(ctx, path, config); err != nil {
return err
}

return config.Root.Save()
}

func DryRun(ctx context.Context, path string) ([]byte, error) {
Expand Down