From 38f5c7f4342983b9171df0535d6bb9fc5064e45d Mon Sep 17 00:00:00 2001 From: ScottWinkler Date: Thu, 29 Mar 2018 14:05:04 -0700 Subject: [PATCH 1/2] Keep permissions when copying --- tools/terraform-bundle/package.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/terraform-bundle/package.go b/tools/terraform-bundle/package.go index 096ef5ddf..c705272b4 100644 --- a/tools/terraform-bundle/package.go +++ b/tools/terraform-bundle/package.go @@ -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 } From 05143987aea8f59a3f9e585e82ff72851737c19e Mon Sep 17 00:00:00 2001 From: ScottWinkler Date: Thu, 29 Mar 2018 14:18:09 -0700 Subject: [PATCH 2/2] Update package.go --- tools/terraform-bundle/package.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/terraform-bundle/package.go b/tools/terraform-bundle/package.go index c705272b4..b21626aa5 100644 --- a/tools/terraform-bundle/package.go +++ b/tools/terraform-bundle/package.go @@ -36,7 +36,6 @@ 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 } @@ -52,6 +51,7 @@ func CopyFile(src, dst string) (err error) { return } err = copyFileContents(src, dst) + os.Chmod(dst, sfi.Mode()) return }