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