courgette/internal/actions/manager.go

26 lines
582 B
Go
Raw Normal View History

package actions
import (
logger "courgette/internal/logging"
)
type ActionsManager struct {
git CliClient
}
func NewActionsManager() ActionsManager {
return ActionsManager{
git: GitClient{},
}
}
// Prefetches and caches the action defined by <actionName> at <destination>.
//
// <actionName> is expected to be the full url of the repository where
// the action lives.
func (a ActionsManager) PrefetchAction(actionName string, destination string) error {
logger.Info("Prefetching action: %s to %s", actionName, destination)
return a.git.Clone(actionName, destination)
}