| 142 | } |
| 143 | |
| 144 | func developRun(opts *DevelopOptions) error { |
| 145 | httpClient, err := opts.HttpClient() |
| 146 | if err != nil { |
| 147 | return err |
| 148 | } |
| 149 | |
| 150 | baseRepo, err := opts.BaseRepo() |
| 151 | if err != nil { |
| 152 | return err |
| 153 | } |
| 154 | |
| 155 | opts.IO.StartProgressIndicatorWithLabel(fmt.Sprintf("Fetching issue #%d", opts.IssueNumber)) |
| 156 | defer opts.IO.StopProgressIndicator() |
| 157 | |
| 158 | issue, err := shared.FindIssueOrPR(httpClient, baseRepo, opts.IssueNumber, []string{"id", "number"}) |
| 159 | if err != nil { |
| 160 | return err |
| 161 | } |
| 162 | |
| 163 | apiClient := api.NewClientFromHTTP(httpClient) |
| 164 | |
| 165 | opts.IO.StartProgressIndicatorWithLabel("Checking linked branch support") |
| 166 | err = api.CheckLinkedBranchFeature(apiClient, baseRepo.RepoHost()) |
| 167 | if err != nil { |
| 168 | return err |
| 169 | } |
| 170 | opts.IO.StopProgressIndicator() |
| 171 | |
| 172 | if opts.List { |
| 173 | return developRunList(opts, apiClient, baseRepo, issue) |
| 174 | } |
| 175 | return developRunCreate(opts, apiClient, baseRepo, issue) |
| 176 | } |
| 177 | |
| 178 | func developRunCreate(opts *DevelopOptions, apiClient *api.Client, issueRepo ghrepo.Interface, issue *api.Issue) error { |
| 179 | branchRepo := issueRepo |