Skip to content

Commit

Permalink
write changes back to file
Browse files Browse the repository at this point in the history
  • Loading branch information
3u13r committed Nov 13, 2023
1 parent 3cab0ee commit 037dcc5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cli/internal/cmd/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,13 @@ func (a *applyCmd) apply(cmd *cobra.Command, configFetcher attestationconfigapi.
// Migrate state file
stateFile, err := state.ReadFromFile(a.fileHandler, constants.StateFilename)
if err != nil {
return err
return fmt.Errorf("reading state file: %w", err)
}
if err := stateFile.Migrate(); err != nil {
return err
return fmt.Errorf("migrating state file: %w", err)
}
if err := stateFile.WriteToFile(a.fileHandler, constants.StateFilename); err != nil {
return fmt.Errorf("writing state file: %w", err)
}

// Validate inputs
Expand Down

0 comments on commit 037dcc5

Please sign in to comment.