MCPcopy Index your code
hub / github.com/nikivdev/go / createPrivateRepository

Function createPrivateRepository

cli/flow/main.go:3240–3251  ·  view source on GitHub ↗
(ctx *snap.Context, owner, repo string)

Source from the content-addressed store, hash-verified

3238}
3239
3240func createPrivateRepository(ctx *snap.Context, owner, repo string) error {
3241 repoFull := fmt.Sprintf("%s/%s", owner, repo)
3242
3243 cmd := exec.Command("gh", "repo", "create", repoFull, "--private", "--confirm")
3244 cmd.Stdout = ctx.Stdout()
3245 cmd.Stderr = ctx.Stderr()
3246 cmd.Stdin = ctx.Stdin()
3247 if err := cmd.Run(); err != nil {
3248 return fmt.Errorf("gh repo create %s: %w", repoFull, err)
3249 }
3250 return nil
3251}
3252
3253func runCreateRepoFromRemote(ctx *snap.Context) error {
3254 if err := ensureGitRepository(); err != nil {

Callers 1

runCreateRepoFromRemoteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected