Keep permissions when copying

This commit is contained in:
ScottWinkler 2018-03-29 14:05:04 -07:00 committed by GitHub
parent f043954352
commit 38f5c7f434
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -36,6 +36,7 @@ func CopyFile(src, dst string) (err error) {
}
dfi, err := os.Stat(dst)
if err != nil {
os.Chmod(dst, sfi.Mode())
if !os.IsNotExist(err) {
return
}