summaryrefslogtreecommitdiff
path: root/template.go
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2019-04-28 20:14:35 -0400
committerDave Henderson <dhenderson@gmail.com>2019-04-28 20:14:35 -0400
commitd2880d9d9e20bbe019f02b0477a5ce74c5fc85f2 (patch)
tree0746e3b2a24cbfd7778c494860ed4d06f32a2428 /template.go
parentaae1a6803067eccbb4df600a5dbf17b93aebd89d (diff)
Fixing file-mode inheritance bug
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'template.go')
-rw-r--r--template.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/template.go b/template.go
index 78736b52..7022664b 100644
--- a/template.go
+++ b/template.go
@@ -177,12 +177,13 @@ func walkDir(dir string, outFileNamer func(string) (string, error), excludeGlob
return nil, err
}
+ fMode := mode
if mode == 0 {
stat, perr := fs.Stat(nextInPath)
if perr == nil {
- mode = stat.Mode()
+ fMode = stat.Mode()
} else {
- mode = dirMode
+ fMode = dirMode
}
}
@@ -194,7 +195,7 @@ func walkDir(dir string, outFileNamer func(string) (string, error), excludeGlob
templates = append(templates, &tplate{
name: nextInPath,
targetPath: nextOutPath,
- mode: mode,
+ mode: fMode,
modeOverride: modeOverride,
})
}