Skip to content

Commit

Permalink
fix: truncate destination files before copying contents
Browse files Browse the repository at this point in the history
  • Loading branch information
braye committed Dec 10, 2022
1 parent 0f3ba78 commit b161b8c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# build artifacts
wow-profile-copy
wow-profile-copy-darwin-aarch64
wow-profile-copy-darwin-amd64
wow-profile-copy-linux-amd64
Expand Down
2 changes: 1 addition & 1 deletion wow-profile-copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func copyFile(src string, dest string) (bytes int64, err error) {
}
defer srcFileHandle.Close()

dstFileHandle, err := os.OpenFile(dest, os.O_RDWR|os.O_CREATE, 0755)
dstFileHandle, err := os.Create(dest)
if err != nil {
return -1, err
}
Expand Down

0 comments on commit b161b8c

Please sign in to comment.