From 4bf5327c424a9e6238f7fd55a5ed62edb9525347 Mon Sep 17 00:00:00 2001 From: Tamer Tas <contact@tmrts.com> Date: Fri, 1 Jul 2016 07:51:13 +0200 Subject: [PATCH] Allow traversal for rendered directories --- pkg/template/template.go | 2 +- pkg/util/osutil/fs.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/template/template.go b/pkg/template/template.go index 4d884d5..a150899 100644 --- a/pkg/template/template.go +++ b/pkg/template/template.go @@ -198,7 +198,7 @@ func (t *dirTemplate) Execute(dirPrefix string) error { target := filepath.Join(dirPrefix, newName) if info.IsDir() { - if err := os.Mkdir(target, 0744); err != nil { + if err := os.Mkdir(target, 0755); err != nil { if !os.IsExist(err) { return err } diff --git a/pkg/util/osutil/fs.go b/pkg/util/osutil/fs.go index fb7c19b..ca8a9e1 100644 --- a/pkg/util/osutil/fs.go +++ b/pkg/util/osutil/fs.go @@ -46,7 +46,7 @@ func DirExists(path string) (bool, error) { // CreateDirs creates directories from the given directory path arguments. func CreateDirs(dirPaths ...string) error { for _, path := range dirPaths { - if err := os.MkdirAll(path, 0744); err != nil { + if err := os.MkdirAll(path, 0755); err != nil { return err } } @@ -57,7 +57,7 @@ func CreateDirs(dirPaths ...string) error { // CopyRecursively copies a given directory to the destination. // Creates the directory if the destination doesn't exist. func CopyRecursively(srcPath, dstPath string) error { - if err := os.Mkdir(dstPath, 0744); err != nil { + if err := os.Mkdir(dstPath, 0755); err != nil { if os.IsNotExist(err) { return fmt.Errorf("directory %q doesn't exist", filepath.Dir(dstPath)) } @@ -80,7 +80,7 @@ func CopyRecursively(srcPath, dstPath string) error { mirrorPath := filepath.Join(dstPath, relPath) if info.IsDir() { - if err := os.Mkdir(mirrorPath, 0744); err != nil { + if err := os.Mkdir(mirrorPath, info.Mode()); err != nil { if !os.IsExist(err) { return err } -- GitLab