Skip to content

Commit

Permalink
Ensure lockfile is written with truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Jul 14, 2019
1 parent bfb3a5e commit d7ffa7e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ func WriteLockfile(lockfile *SourceLockfile, config *SourceConfig) error {
return err
}

file, err := os.OpenFile(config.LockfilePath, os.O_RDWR|os.O_CREATE, 0666)
flags := os.O_RDWR | os.O_CREATE | os.O_TRUNC
file, err := os.OpenFile(config.LockfilePath, flags, 0666)
if err != nil {
return err
}
Expand Down

0 comments on commit d7ffa7e

Please sign in to comment.