MCPcopy Create free account
hub / github.com/cli/cli / developRun

Function developRun

pkg/cmd/issue/develop/develop.go:167–199  ·  view source on GitHub ↗
(opts *DevelopOptions)

Source from the content-addressed store, hash-verified

165}
166
167func 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
201func developRunCreate(opts *DevelopOptions, apiClient *api.Client, issueRepo ghrepo.Interface, issue *api.Issue) error {
202 branchRepo := issueRepo

Callers 2

TestDevelopRunFunction · 0.85
NewCmdDevelopFunction · 0.85

Calls 8

NewClientFromHTTPFunction · 0.92
CheckLinkedBranchFeatureFunction · 0.92
developRunListFunction · 0.85
developRunCreateFunction · 0.85
BaseRepoMethod · 0.65
StopProgressIndicatorMethod · 0.65
RepoHostMethod · 0.65

Tested by 1

TestDevelopRunFunction · 0.68