diff --git a/cmd/go-starter-drone/main.go b/cmd/go-starter-drone/main.go index 33b31ad..3947d3d 100644 --- a/cmd/go-starter-drone/main.go +++ b/cmd/go-starter-drone/main.go @@ -40,7 +40,7 @@ func usage() { out := flag.CommandLine.Output() _, _ = fmt.Fprintf(out, "go-starter-drone version %v (commit %v)\n", version, commit) _, _ = fmt.Fprintf(out, "\n") - _, _ = fmt.Fprintf(out, "Usage: %s [flags] \n", os.Args[0]) + _, _ = fmt.Fprintf(out, "Usage: %s [flags] \n", os.Args[0]) _, _ = fmt.Fprintf(out, "\nExample:\n") _, _ = fmt.Fprintf(out, " %s https://cloud.drone.io adobe awesome-project\n", os.Args[0]) _, _ = fmt.Fprintf(out, "\nFlags:\n") @@ -72,12 +72,12 @@ func main() { org, repo := flag.Arg(1), flag.Arg(2) if org == "" { flag.Usage() - ui.Fatalf("GitHub organisation is empty\n") + ui.Fatalf("Organisation name is empty\n") } if repo == "" { flag.Usage() - ui.Fatalf("GitHub repository name is empty\n") + ui.Fatalf("Repository name is empty\n") } // get credentials from OSX keychain diff --git a/cmd/go-starter-github/main.go b/cmd/go-starter-github/main.go index 7c27fea..79bb1d5 100644 --- a/cmd/go-starter-github/main.go +++ b/cmd/go-starter-github/main.go @@ -41,12 +41,13 @@ func usage() { } func main() { - var remote, deployKey string + var remote, branch, deployKey string var public, issues, projects, wiki bool var collaborators SliceFlag flag.Usage = usage flag.StringVar(&remote, "remote", "upstream", "Name of the remote in local repository") + flag.StringVar(&branch, "branch", "master", "Name of the master branch") flag.BoolVar(&issues, "with-issues", false, "Enable issues in GitHub") flag.BoolVar(&projects, "with-projects", false, "Enable projects in GitHub") flag.BoolVar(&wiki, "with-wiki", false, "Enable wiki page in GitHub") @@ -92,11 +93,12 @@ func main() { // create repository repo, _, err := cli.Repositories.Create(context.Background(), org, &github.Repository{ - Name: github.String(name), - Private: github.Bool(!public), - HasIssues: github.Bool(issues), - HasProjects: github.Bool(projects), - HasWiki: github.Bool(wiki), + Name: github.String(name), + Private: github.Bool(!public), + HasIssues: github.Bool(issues), + HasProjects: github.Bool(projects), + HasWiki: github.Bool(wiki), + MasterBranch: github.String(branch), }) if err != nil { @@ -136,7 +138,7 @@ func main() { } // push to remote - if err := run("git", "push", "--set-upstream", "upstream", "master"); err != nil { + if err := run("git", "push", "--set-upstream", remote, branch); err != nil { ui.Fatalf("An error occurred while running git push: %v\n", err) } diff --git a/cmd/go-starter/main.go b/cmd/go-starter/main.go index a281585..cf74f9b 100644 --- a/cmd/go-starter/main.go +++ b/cmd/go-starter/main.go @@ -30,7 +30,7 @@ func usage() { _, _ = fmt.Fprintf(out, "\n") _, _ = fmt.Fprintf(out, "Usage: %s [flags]