예제 #1
0
파일: goxc.go 프로젝트: relops/goxc
//merge configuration file
//maybe oneday: parse source
func mergeConfiguredSettings(dir string, configName string, isWriteMain, isWriteLocal bool) error {
	if settings.IsVerbose() {
		log.Printf("loading configured settings")
	}
	configuredSettings, err := config.LoadJsonConfigOverrideable(dir, configName, !isWriteMain && !isWriteLocal, isWriteLocal, settings.IsVerbose())
	if settings.IsVerbose() {
		log.Printf("Settings from config %s: %+v : %v", configName, configuredSettings, err)
	}
	//TODO: further error handling ?
	if err == nil {
		settings = config.Merge(settings, configuredSettings)
	}
	return err
}
예제 #2
0
//merge configuration file
//maybe oneday: parse source
func mergeConfiguredSettings(dir string, configName string, isWriteMain, isWriteLocal bool) error {
	if settings.IsVerbose() {
		log.Printf("loading configured settings")
	}
	configuredSettings, err := config.LoadJsonConfigOverrideable(dir, configName, !isWriteMain && !isWriteLocal, isWriteLocal, settings.IsVerbose())
	if settings.IsVerbose() {
		log.Printf("Settings from config %s: %+v : %v", configName, configuredSettings, err)
	}
	//TODO: further error handling ?
	if err != nil {
		return err
	}
	// v0.14.x merge certain settings (particularly for pkg-build!)
	settings.MergeAliasedTaskSettings(tasks.TASK_ALIASES_FOR_MERGING_SETTINGS)
	configuredSettings.MergeAliasedTaskSettings(tasks.TASK_ALIASES_FOR_MERGING_SETTINGS)
	settings = config.Merge(settings, configuredSettings)
	return err
}