Exemplo n.º 1
0
func (cont *OrgController) LoadConfig() error {
	logger.Debug("loading org config")

	var err error
	if cont.config == nil {
		cont.config, err = config.NewOrg()
		if err != nil {
			return err
		}
	}

	logger.Debugf("checking if local org config '%s' exists", OrgConfigFile)
	exists, err := cont.env.fs.local.Exists(OrgConfigFile)
	if err != nil {
		return err
	}

	if exists {
		logger.Debug("reading local org config")
		orgConfig, err := cont.env.fs.local.Read(OrgConfigFile)
		if err != nil {
			return err
		}

		err = cont.config.Load(orgConfig)
		if err != nil {
			return err
		}
	}

	logger.Trace("returning nil error")
	return nil
}
Exemplo n.º 2
0
func (app *AdminApp) CreateOrgConfig() {
	var err error
	app.config.org, err = config.NewOrg()
	checkAppFatal("Couldn't initialize org config: %s", err)

	app.config.org.Data.Id = app.entities.org.Data.Body.Id
	app.config.org.Data.Name = app.entities.org.Data.Body.Name
}
Exemplo n.º 3
0
func (app *AdminApp) LoadOrgConfig() {
	orgConfig, err := app.fs.local.Read(OrgConfigFile)
	checkUserFatal("Couldn't read org config: %s. Are you in an org directory?", err)

	app.config.org, err = config.NewOrg()
	checkAppFatal("Couldn't initialize org config: %s", err)

	err = app.config.org.Load(orgConfig)
	checkAppFatal("Couldn't load org config: %s", err)
}