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