@@ -11,26 +11,26 @@ import (
1111 "github.com/trueforge-org/forgetool/pkg/containers/website"
1212)
1313
14- var containerGenListLongHelp = strings .TrimSpace (`
14+ var containersGenListLongHelp = strings .TrimSpace (`
1515Generates a JSON file listing all containers found under the given path(s).
1616Each container is identified by its docker-bake.hcl file.
1717` )
1818
19- func defaultContainerGenListOptionsFactory () * website.ContainerListOptions {
19+ func defaultContainersGenListOptionsFactory () * website.ContainerListOptions {
2020 return & website.ContainerListOptions {
2121 OutputPath : "./containers.json" ,
2222 }
2323}
2424
25- func defaultContainerGenListGetData (opts * website.ContainerListOptions ) fs.WalkDirFunc {
25+ func defaultContainersGenListGetData (opts * website.ContainerListOptions ) fs.WalkDirFunc {
2626 return opts .GetContainerData
2727}
2828
29- func defaultContainerGenListWrite (opts * website.ContainerListOptions ) error {
29+ func defaultContainersGenListWrite (opts * website.ContainerListOptions ) error {
3030 return opts .WriteContainerList ()
3131}
3232
33- var defaultContainerGenListWalk = func (paths []string , fn fs.WalkDirFunc ) error {
33+ var defaultContainersGenListWalk = func (paths []string , fn fs.WalkDirFunc ) error {
3434 if len (paths ) == 0 {
3535 paths = []string {"./apps" }
3636 }
@@ -43,29 +43,29 @@ var defaultContainerGenListWalk = func(paths []string, fn fs.WalkDirFunc) error
4343}
4444
4545var (
46- containerGenListWalk = defaultContainerGenListWalk
47- containerGenListOptionsFactory = defaultContainerGenListOptionsFactory
48- containerGenListGetData = defaultContainerGenListGetData
49- containerGenListWrite = defaultContainerGenListWrite
50- containerGenListRunner = runContainerGenList
51- containerGenListOnError = func (err error ) { log .Fatal ().Err (err ).Msg ("container list generation failed" ) }
46+ containersGenListWalk = defaultContainersGenListWalk
47+ containersGenListOptionsFactory = defaultContainersGenListOptionsFactory
48+ containersGenListGetData = defaultContainersGenListGetData
49+ containersGenListWrite = defaultContainersGenListWrite
50+ containersGenListRunner = runContainersGenList
51+ containersGenListOnError = func (err error ) { log .Fatal ().Err (err ).Msg ("container list generation failed" ) }
5252)
5353
54- func runContainerGenList (args []string ) error {
55- opts := containerGenListOptionsFactory ()
56- if err := containerGenListWalk (args , containerGenListGetData (opts )); err != nil {
54+ func runContainersGenList (args []string ) error {
55+ opts := containersGenListOptionsFactory ()
56+ if err := containersGenListWalk (args , containersGenListGetData (opts )); err != nil {
5757 return fmt .Errorf ("failed to generate container list json file: %w" , err )
5858 }
5959
60- if err := containerGenListWrite (opts ); err != nil {
60+ if err := containersGenListWrite (opts ); err != nil {
6161 return fmt .Errorf ("failed to write container list json file: %w" , err )
6262 }
6363
6464 return nil
6565}
6666
67- var genContainerListCmd = & cobra.Command {
68- Use : "gencontainerlist " ,
67+ var genContainersListCmd = & cobra.Command {
68+ Use : "gencontainerslist " ,
6969 Short : "Generate container list json file" ,
7070 Long : containerGenListLongHelp ,
7171 Example : "forgetool containers gencontainerlist <path to apps folder>" ,
0 commit comments