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