func()

in config/stack.go [154:188]


func (s *Stack) FindAndRead(path string, required bool) error {
	errs := []error{}

	config, err := s.findAndReadConfig(path)
	s.Config = config
	errs = append(errs, err)

	tfPath, err := s.findTFFolder(path)
	s.Config.PathTerraform = tfPath
	errs = append(errs, err)

	scriptPath, err := s.findDSFolder(path, "scripts")
	s.Config.PathScripts, _ = filepath.Rel(path, scriptPath)
	errs = append(errs, err)

	messagePath, err := s.findDSFolder(path, "messages")
	s.Config.PathMessages, _ = filepath.Rel(path, messagePath)
	errs = append(errs, err)

	if config.Description == "" {
		descText := fmt.Sprintf("%s/description.txt", messagePath)
		description, err := ioutil.ReadFile(descText)
		s.Config.Description = string(description)
		errs = append(errs, err)
	}

	s.Config.convertHardset()
	s.Config.defaultAuthorSettings()

	if required && len(errs) > 0 {
		return errs[0]
	}

	return nil
}