-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(generate): add generate app-scaffold command
- Loading branch information
1 parent
8eedadf
commit 2cce2ca
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
Copyright (C) 2021-2025, Kubefirst | ||
This program is licensed under MIT. | ||
See the LICENSE file for more details. | ||
*/ | ||
package cmd | ||
|
||
import ( | ||
"github.com/konstructio/kubefirst/internal/progress" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
func GenerateCommand() *cobra.Command { | ||
generateCommand := &cobra.Command{ | ||
Use: "generate", | ||
Short: "code generator helpers", | ||
} | ||
|
||
// wire up new commands | ||
generateCommand.AddCommand(generateApp()) | ||
|
||
return generateCommand | ||
} | ||
|
||
func generateApp() *cobra.Command { | ||
var name string | ||
var environments []string | ||
|
||
appScaffoldCmd := &cobra.Command{ | ||
Use: "app-scaffold", | ||
Short: "scaffold the gitops application repo", | ||
TraverseChildren: true, | ||
Run: func(_ *cobra.Command, _ []string) { | ||
progress.Success("hello world") | ||
}, | ||
} | ||
|
||
appScaffoldCmd.Flags().StringVarP(&name, "name", "n", "", "name of the app") | ||
appScaffoldCmd.MarkFlagRequired("name") | ||
appScaffoldCmd.Flags().StringSliceVar(&environments, "environments", []string{"development", "staging", "production"}, "environment names to create") | ||
|
||
return appScaffoldCmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters