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