Skip to content

Commit

Permalink
feat: Add --kubernetes support to slu file-templates gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejsika committed Jul 19, 2023
1 parent e074f4f commit 1b49d3f
Show file tree
Hide file tree
Showing 2 changed files with 15 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 @@ -8,6 +8,7 @@ import (
)

var FlagTerraform bool
var FlagKubernetes bool
var FlagNodeJS bool
var FlagNextJs bool

Expand All @@ -21,6 +22,9 @@ var Cmd = &cobra.Command{
if FlagTerraform {
content += "\n" + gitignore.GitignoreTerraform
}
if FlagKubernetes {
content += "\n" + gitignore.GitignoreKubernetes
}
if FlagNodeJS {
content += "\n" + gitignore.GitignoreNodeJS
}
Expand All @@ -39,6 +43,12 @@ func init() {
false,
"Add Terraform part",
)
Cmd.Flags().BoolVar(
&FlagKubernetes,
"kubernetes",
false,
"Add Kubernetes part",
)
Cmd.Flags().BoolVar(
&FlagNodeJS,
"node",
Expand Down
5 changes: 5 additions & 0 deletions file_templates/gitignore/gitignore.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ var GitignoreNextJs = `# NodeJS
out
`

var GitignoreKubernetes = `# Kuberneres
kubeconfig.yml
kubeconfig.*.yml
`

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

0 comments on commit 1b49d3f

Please sign in to comment.