Skip to content

Commit

Permalink
feat(file_templates/gitignore): Add Helm support (by --helm arg)
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejsika committed Jun 22, 2024
1 parent 175a8e0 commit d5826fc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cmd/file_templates/gitignore/gitignore.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var FlagTerraform bool
var FlagKubernetes bool
var FlagNodeJS bool
var FlagNextJs bool
var FlagHelm bool

var Cmd = &cobra.Command{
Use: "gitignore",
Expand All @@ -31,6 +32,9 @@ var Cmd = &cobra.Command{
if FlagNextJs {
content += "\n" + gitignore.GitignoreNextJs
}
if FlagHelm {
content += "\n" + gitignore.GitignoreHelm
}
gitignore.CreateGitignore(content)
},
}
Expand Down Expand Up @@ -61,4 +65,10 @@ func init() {
false,
"Add Next.js part",
)
Cmd.Flags().BoolVar(
&FlagHelm,
"helm",
false,
"Add Helm part",
)
}
4 changes: 4 additions & 0 deletions file_templates/gitignore/gitignore.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ kubeconfig.yml
kubeconfig.*.yml
`

var GitignoreHelm = `# Helm
*.tgz
`

func CreateGitignore(content string) {
err := os.WriteFile(".gitignore", []byte(content), 0644)
if err != nil {
Expand Down

0 comments on commit d5826fc

Please sign in to comment.