Skip to content

Commit 32e5d05

Browse files
committed
[Fix] Warn user when --template is passed with incompatible flags
1 parent 58f62a4 commit 32e5d05

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

pkg/cmd/repo/create/create.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package create
22

33
import (
4+
"errors"
45
"fmt"
56
"net/http"
67
"path"
@@ -76,6 +77,10 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co
7677
return runF(opts)
7778
}
7879

80+
if opts.Template != "" && (opts.Homepage != "" || opts.Team != "" || !opts.EnableIssues || !opts.EnableWiki) {
81+
return &cmdutil.FlagError{Err: errors.New(`the '--template' option is not supported with '--homepage, --team, --enable-issues or --enable-wiki'`)}
82+
}
83+
7984
return createRun(opts)
8085
},
8186
}

pkg/cmd/repo/create/http.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ type repoTemplateInput struct {
2929
OwnerID string `json:"ownerId,omitempty"`
3030

3131
RepositoryID string `json:"repositoryId,omitempty"`
32+
Description string `json:"description,omitempty"`
3233
}
3334

3435
// repoCreate creates a new GitHub repository

0 commit comments

Comments
 (0)