MCPcopy
hub / github.com/cli/cli / developRun

Function developRun

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

Source from the content-addressed store, hash-verified

142}
143
144func 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
178func developRunCreate(opts *DevelopOptions, apiClient *api.Client, issueRepo ghrepo.Interface, issue *api.Issue) error {
179 branchRepo := issueRepo

Callers 2

TestDevelopRunFunction · 0.85
NewCmdDevelopFunction · 0.85

Calls 9

FindIssueOrPRFunction · 0.92
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