Skip to content

Commit

Permalink
save cache to another file
Browse files Browse the repository at this point in the history
  • Loading branch information
skudasov committed Oct 18, 2024
1 parent beabeed commit aa79d5c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions framework/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ func Store[T any](cfg *T) error {
if err != nil {
return err
}
L.Info().Str("OutputFile", baseConfigPath).Msg("Storing configuration output")
cachedOutName := fmt.Sprintf("%s-cache.toml", strings.Replace(baseConfigPath, ".toml", "", -1))
L.Info().Str("OutputFile", cachedOutName).Msg("Storing configuration output")
d, err := toml.Marshal(cfg)
if err != nil {
return err
}
return os.WriteFile(filepath.Join(DefaultConfigDir, baseConfigPath), d, os.ModePerm)
return os.WriteFile(filepath.Join(DefaultConfigDir, cachedOutName), d, os.ModePerm)
}

0 comments on commit aa79d5c

Please sign in to comment.