func doCreate(c *cli.Context) { name := c.Args().First() if len(name) == 0 { return } // check configuration configuration, err := OpenConfiguration() if err != nil { fmt.Println(err) return } if configuration.GithubToken == "" { configuration.GithubToken = PromptPersonalGithubToken() configuration.Persist() } // set repository attributes newRepository := github.Repository{Name: &name} prompt := c.Bool(flagDetail) if description := GetRepositryField(flagDesc, c.String(flagDesc), prompt).(string); description != "" { newRepository.Description = &description } if homepage := GetRepositryField(flagHP, c.String(flagHP), prompt).(string); homepage != "" { newRepository.Homepage = &homepage } if teamid := GetRepositryField(flagTeamID, c.Int(flagTeamID), prompt).(int); teamid != 0 { newRepository.TeamID = &teamid } private := GetRepositryField(flagPrivate, c.Bool(flagPrivate), prompt).(bool) newRepository.Private = &private issue := GetRepositryField(flagIssue, c.Bool(flagIssue), prompt).(bool) newRepository.HasIssues = &issue wiki := GetRepositryField(flagWiki, c.Bool(flagWiki), prompt).(bool) newRepository.HasWiki = &wiki download := GetRepositryField(flagDownload, c.Bool(flagDownload), prompt).(bool) newRepository.HasDownloads = &download // create repository org := c.String(flagOrg) client := NewClient(configuration) repository, _ := observeChannel(client.CreateRepository(org, &newRepository)) if repository == nil { return } output := "\n\n" + "=========================\n" + " \n" + "@{g}* We are sccessful in Creating a repository! Push an existing repository from the command line@{|}\n" + " \n" + "git remote add origin %s \n" + "git push -u origin master\n" + " \n" + "=========================\n" + "\n\n" color.Printf(output, *repository.GitURL) }