Skip to content

Commit c3cbe4e

Browse files
authored
acc: When copying files, include permissions (#2662)
This helps when having a custom executable script in the test dir.
1 parent 79e9768 commit c3cbe4e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

acceptance/acceptance_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,12 @@ func copyFile(src, dst string) error {
672672
}
673673
defer in.Close()
674674

675-
out, err := os.Create(dst)
675+
info, err := in.Stat()
676+
if err != nil {
677+
return err
678+
}
679+
680+
out, err := os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, info.Mode())
676681
if err != nil {
677682
return err
678683
}

0 commit comments

Comments
 (0)