func AutoUpdateApply(ctx *cli.Context) { auth.AttemptLogin(ctx) project, err := models.GetProject(ctx.String("project")) utils.ExitIfErr(err) err = auApplyFunc(project.Slug, ctx.Args()) utils.ExitIfErr(err) }
func Configure(ctx *cli.Context) { slug := ctx.Args().First() project, err := models.GetProject(slug) utils.ExitIfErr(err) err = confFunc(project) utils.ExitIfErr(err) }
func DependenciesPush(ctx *cli.Context) { project, err := models.GetProject() utils.ExitIfErr(err) var files []string if ctx.IsSet("files") { // Only call strings.Split on non-empty strings, otherwise len(strings) will be 1 instead of 0. files = strings.Split(ctx.String("files"), ",") } err = models.PushDependencyFiles(project.Slug, files) utils.ExitIfErr(err) }
func ProjectsUpdate(ctx *cli.Context) { project, err := models.GetProject(ctx.Args().First()) utils.ExitIfErr(err) var name, desc *string var monitored *bool if ctx.IsSet("name") { nameString := ctx.String("name") name = &nameString } if ctx.IsSet("desc") { descString := ctx.String("desc") desc = &descString } if ctx.IsSet("monitored") { mon := ctx.Bool("monitored") monitored = &mon } err = project.Update(name, desc, monitored) utils.ExitIfErr(err) }
func DependencyAlertsList(ctx *cli.Context) { project, err := models.GetProject(ctx.Args().First()) utils.ExitIfErr(err) err = models.ListDependencyAlerts(project) utils.ExitIfErr(err) }
func DependencyFilesList(ctx *cli.Context) { project, err := models.GetProject() utils.ExitIfErr(err) err = models.ListDependencyFiles(project) utils.ExitIfErr(err) }
func ProjectsSync(ctx *cli.Context) { project, err := models.GetProject(ctx.Args().First()) utils.ExitIfErr(err) err = project.Sync() utils.ExitIfErr(err) }