| 165 | } |
| 166 | |
| 167 | func developRun(opts *DevelopOptions) error { |
| 168 | httpClient, err := opts.HttpClient() |
| 169 | if err != nil { |
| 170 | return err |
| 171 | } |
| 172 | |
| 173 | baseRepo, err := opts.BaseRepo() |
| 174 | if err != nil { |
| 175 | return err |
| 176 | } |
| 177 | |
| 178 | opts.IO.StartProgressIndicatorWithLabel(fmt.Sprintf("Fetching issue #%d", opts.IssueNumber)) |
| 179 | defer opts.IO.StopProgressIndicator() |
| 180 | |
| 181 | issue, err := shared.FindIssueOrPR(httpClient, baseRepo, opts.IssueNumber, []string{"id", "number"}) |
| 182 | if err != nil { |
| 183 | return err |
| 184 | } |
| 185 | |
| 186 | apiClient := api.NewClientFromHTTP(httpClient) |
| 187 | |
| 188 | opts.IO.StartProgressIndicatorWithLabel("Checking linked branch support") |
| 189 | err = api.CheckLinkedBranchFeature(apiClient, baseRepo.RepoHost()) |
| 190 | if err != nil { |
| 191 | return err |
| 192 | } |
| 193 | opts.IO.StopProgressIndicator() |
| 194 | |
| 195 | if opts.List { |
| 196 | return developRunList(opts, apiClient, baseRepo, issue) |
| 197 | } |
| 198 | return developRunCreate(opts, apiClient, baseRepo, issue) |
| 199 | } |
| 200 | |
| 201 | func developRunCreate(opts *DevelopOptions, apiClient *api.Client, issueRepo ghrepo.Interface, issue *api.Issue) error { |
| 202 | branchRepo := issueRepo |