configcommands/update_orgs.go
func (c *UpdateOrgsConfigurationCommand) Execute(args []string) error {
	c.initConfig()
	orgs, err := c.ConfigManager.Orgs()
	if err != nil {
		return err
	}
	errorString := ""
	convertToBool("enable-delete-orgs", &orgs.EnableDeleteOrgs, c.EnableDeleteOrgs, &errorString)
	orgs.ProtectedOrgs = removeFromSlice(addToSlice(orgs.ProtectedOrgs, c.ProtectedOrgsToAdd, &errorString), c.ProtectedOrgsToRemove)

	if errorString != "" {
		return errors.New(errorString)
	}

	if err := c.ConfigManager.SaveOrgs(orgs); err != nil {
		return err
	}
	fmt.Println("The orgs.yml has been updated")
	return nil
}
func (c *UpdateOrgsConfigurationCommand) Execute(args []string) error {
	c.initConfig()
	orgs, err := c.ConfigManager.Orgs()
	if err != nil {
		return err
	}
	errorString := ""
	convertToBool("enable-delete-orgs", &orgs.EnableDeleteOrgs, c.EnableDeleteOrgs, &errorString)
	orgs.ProtectedOrgs = removeFromSlice(addToSlice(orgs.ProtectedOrgs, c.ProtectedOrgsToAdd, &errorString), c.ProtectedOrgsToRemove)

	if errorString != "" {
		return errors.New(errorString)
	}

	if err := c.ConfigManager.SaveOrgs(orgs); err != nil {
		return err
	}
	fmt.Println("The orgs.yml has been updated")
	return nil
}
func ( c * UpdateOrgsConfigurationCommand ) Execute ( args [ ] string ) error { c . initConfig ( ) orgs , err := c . ConfigManager . Orgs ( ) if err != nil { return err } errorString := " " convertToBool ( " " , & orgs . EnableDeleteOrgs , c . EnableDeleteOrgs , & errorString ) orgs . ProtectedOrgs = removeFromSlice ( addToSlice ( orgs . ProtectedOrgs , c . ProtectedOrgsToAdd , & errorString ) , c . ProtectedOrgsToRemove ) if errorString != " " { return errors . New ( errorString ) } if err := c . ConfigManager . SaveOrgs ( orgs ) ; err != nil { return err } fmt . Println ( " " ) return nil }
//Execute - updates org configuration`
Execute - updates org configuration