(opts *InstallOptions, canPrompt bool)
| 959 | } |
| 960 | |
| 961 | func resolveScope(opts *InstallOptions, canPrompt bool) (registry.Scope, error) { |
| 962 | if opts.Dir != "" { |
| 963 | return registry.Scope(opts.Scope), nil |
| 964 | } |
| 965 | |
| 966 | if opts.ScopeChanged || !canPrompt { |
| 967 | return registry.Scope(opts.Scope), nil |
| 968 | } |
| 969 | |
| 970 | var repoName string |
| 971 | if opts.Remotes != nil { |
| 972 | if remotes, err := opts.Remotes(); err == nil && len(remotes) > 0 { |
| 973 | repoName = ghrepo.FullName(remotes[0].Repo) |
| 974 | } |
| 975 | } |
| 976 | idx, err := opts.Prompter.Select("Installation scope:", "", registry.ScopeLabels(repoName)) |
| 977 | if err != nil { |
| 978 | return "", err |
| 979 | } |
| 980 | if idx == 0 { |
| 981 | return registry.ScopeProject, nil |
| 982 | } |
| 983 | return registry.ScopeUser, nil |
| 984 | } |
| 985 | |
| 986 | func buildInstallPlans(opts *InstallOptions, selectedSkills []discovery.Skill, selectedHosts []*registry.AgentHost, scope registry.Scope, gitRoot, homeDir string, canPrompt bool) ([]installPlan, error) { |
| 987 | byDir := make(map[string]*installPlan) |
no test coverage detected