Move repos subcommand to a dedicated source file (#137)

Signed-off-by: yxxhero <aiopsclub@163.com>
This commit is contained in:
yxxhero
2022-06-06 09:12:54 +09:00
committed by GitHub
parent 9032395818
commit bb20fcaf5b
3 changed files with 25 additions and 14 deletions
+24
View File
@@ -0,0 +1,24 @@
package cmd
import (
"github.com/helmfile/helmfile/pkg/app"
"github.com/helmfile/helmfile/pkg/config"
"github.com/urfave/cli"
)
func addReposSubcommand(cliApp *cli.App) {
cliApp.Commands = append(cliApp.Commands, cli.Command{
Name: "repos",
Usage: "sync repositories from state file (helm repo add && helm repo update)",
Flags: []cli.Flag{
cli.StringFlag{
Name: "args",
Value: "",
Usage: "pass args to helm exec",
},
},
Action: Action(func(a *app.App, c config.ConfigImpl) error {
return a.Repos(c)
}),
})
}
+1
View File
@@ -26,6 +26,7 @@ func RootCommand() *cli.App {
// add subcommands
addDepsSubcommand(cliApp)
addReposSubcommand(cliApp)
return cliApp
}