Skip to content

Commit

Permalink
Fix update command
Browse files Browse the repository at this point in the history
  • Loading branch information
vyPal committed Jan 1, 2024
1 parent 7b400e0 commit dc2f041
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,13 @@ func update(c *cli.Context) error {
}
defer dstFile.Close()

// Reset the read position of the temporary file
_, err = tmpFile.Seek(0, 0)
if err != nil {
fmt.Println("Failed to reset the read position of the temporary file:", err)
return nil
}

// Copy the temporary file to the destination file
_, err = io.Copy(dstFile, tmpFile)
if err != nil {
Expand Down

0 comments on commit dc2f041

Please sign in to comment.