clone remote repo after creating with gitignore and license
This commit is contained in:
parent
9ecbdb26c5
commit
5c7da584e5
1 changed files with 12 additions and 2 deletions
|
|
@ -347,14 +347,19 @@ func createRun(opts *CreateOptions) error {
|
|||
}
|
||||
} else {
|
||||
if opts.IO.CanPrompt() {
|
||||
if !createLocalDirectory {
|
||||
if !createLocalDirectory && (gitIgnoreTemplate == "" && repoLicenseTemplate == "") {
|
||||
err := prompt.Confirm(fmt.Sprintf(`Create a local project directory for "%s"?`, ghrepo.FullName(repo)), &createLocalDirectory)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
} else if !createLocalDirectory && (gitIgnoreTemplate != "" || repoLicenseTemplate != "") {
|
||||
err := prompt.Confirm(fmt.Sprintf(`Clone the remote project directory "%s"?`, ghrepo.FullName(repo)), &createLocalDirectory)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
if createLocalDirectory {
|
||||
if createLocalDirectory && (gitIgnoreTemplate == "" && repoLicenseTemplate == "") {
|
||||
path := repo.RepoName()
|
||||
checkoutBranch := ""
|
||||
if opts.Template != "" {
|
||||
|
|
@ -369,6 +374,11 @@ func createRun(opts *CreateOptions) error {
|
|||
if isTTY {
|
||||
fmt.Fprintf(stderr, "%s Initialized repository in \"%s\"\n", cs.SuccessIcon(), path)
|
||||
}
|
||||
} else if createLocalDirectory && (gitIgnoreTemplate != "" || repoLicenseTemplate != "") {
|
||||
_, err := git.RunClone(remoteURL, []string{})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue