We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2847e7b commit 061fbacCopy full SHA for 061fbac
template.go
@@ -8,6 +8,7 @@ import (
8
"os"
9
"path/filepath"
10
"strings"
11
+ "syscall"
12
"text/template"
13
)
14
@@ -107,7 +108,9 @@ func generateFile(config Config, containers Context) bool {
107
108
if config.Dest != "" {
109
110
contents := []byte{}
- if _, err := os.Stat(config.Dest); err == nil {
111
+ if fi, err := os.Stat(config.Dest); err == nil {
112
+ dest.Chmod(fi.Mode())
113
+ dest.Chown(int(fi.Sys().(*syscall.Stat_t).Uid), int(fi.Sys().(*syscall.Stat_t).Gid))
114
contents, err = ioutil.ReadFile(config.Dest)
115
if err != nil {
116
log.Fatalf("unable to compare current file contents: %s: %s\n", config.Dest, err)
0 commit comments