Skip to content

Commit

Permalink
enhancement: remove /**/terraform/**/main.tf from default encryption …
Browse files Browse the repository at this point in the history
…filters (#537)

* remove /**/terraform/**/main.tf from default encryption filters

* check if files do not exist before write
  • Loading branch information
maciaszczykm authored Aug 27, 2024
1 parent c72c6af commit 617bfd8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pkg/common/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ const Gitattributes = `/**/helm/**/values.yaml filter=plural-crypt diff=plural-c
/**/helm/**/values.yaml* filter=plural-crypt diff=plural-crypt
/**/helm/**/README.md* filter=plural-crypt diff=plural-crypt
/**/helm/**/default-values.yaml* filter=plural-crypt diff=plural-crypt
/**/terraform/**/main.tf filter=plural-crypt diff=plural-crypt
/**/terraform/**/main.tf* filter=plural-crypt diff=plural-crypt
/**/manifest.yaml filter=plural-crypt diff=plural-crypt
/**/output.yaml filter=plural-crypt diff=plural-crypt
/diffs/**/* filter=plural-crypt diff=plural-crypt
Expand Down Expand Up @@ -60,12 +58,16 @@ func CryptoInit(c *cli.Context) error {
}
}

if err := utils.WriteFile(GitAttributesFile, []byte(Gitattributes)); err != nil {
return err
if !utils.Exists(GitAttributesFile) {
if err := utils.WriteFile(GitAttributesFile, []byte(Gitattributes)); err != nil {
return err
}
}

if err := utils.WriteFile(GitIgnoreFile, []byte(Gitignore)); err != nil {
return err
if !utils.Exists(GitIgnoreFile) {
if err := utils.WriteFile(GitIgnoreFile, []byte(Gitignore)); err != nil {
return err
}
}

_, err := crypto.Build()
Expand Down

0 comments on commit 617bfd8

Please sign in to comment.