func()

in config/stack.go [88:113]


func (s *Stack) findDSFolder(path, folder string) (string, error) {
	switch folder {
	case "messages":
		if s.Config.PathMessages != "" {
			return s.Config.PathMessages, nil
		}
	case "scripts":
		if s.Config.PathScripts != "" {
			return s.Config.PathScripts, nil
		}
	}

	dsPath := filepath.Join(path, folder)

	if _, err := os.Stat(dsPath); err == nil {
		return dsPath, nil
	}

	dsPath = filepath.Join(path, ".deploystack", folder)

	if _, err := os.Stat(dsPath); err == nil {
		return dsPath, nil
	}

	return fmt.Sprintf("./%s", folder), fmt.Errorf("requirement (%s) was not found either in the root, or in .deploystack folder nor was it set in deploystack.json", folder)
}