Skip to content

Commit

Permalink
fix: remove temp file rename
Browse files Browse the repository at this point in the history
Signed-off-by: mrjoelkamp <[email protected]>
  • Loading branch information
mrjoelkamp committed Jun 11, 2024
1 parent 626088b commit e7bb364
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions metadata/updater/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -620,12 +620,8 @@ func (update *Updater) persistMetadata(roleName string, data []byte) error {
}
// caching enabled, proceed with persisting the metadata locally
fileName := filepath.Join(update.cfg.LocalMetadataDir, fmt.Sprintf("%s.json", url.QueryEscape(roleName)))
cwd, err := os.Getwd()
if err != nil {
return err
}
// create a temporary file
file, err := os.CreateTemp(cwd, "tuf_tmp")
file, err := os.CreateTemp(update.cfg.LocalMetadataDir, "tuf_tmp")
if err != nil {
return err
}
Expand Down

0 comments on commit e7bb364

Please sign in to comment.