package turn import ( "context" "path/filepath" "tangled.org/guid.foo/simmer/plugin" ) // pluginsDir is where the turn clones the Mandate's plugins, under the // work directory. const pluginsDir = ".plugins" // clonePlugins clones each plugin repository into the work directory, // and answers each clone's directory for --plugin-dir. func clonePlugins(ctx context.Context, workDir string, plugins []string) ([]string, error) { dirs, err := plugin.Dirs(filepath.Join(workDir, pluginsDir), plugins) if err != nil { return nil, err } for i, repository := range plugins { if err := plugin.Clone(ctx, repository, dirs[i]); err != nil { return nil, err } } return dirs, nil }