From dc2f0411893c370c8ca02efacf086bd75d984fc7 Mon Sep 17 00:00:00 2001 From: vyPal <66716025+vyPal@users.noreply.github.com> Date: Mon, 1 Jan 2024 19:06:43 +0100 Subject: [PATCH] Fix update command --- src/versions.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/versions.go b/src/versions.go index eed6cde..6952c86 100644 --- a/src/versions.go +++ b/src/versions.go @@ -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 {