[Fix] Warn user when --template is passed with incompatible flags
This commit is contained in:
parent
58f62a4a15
commit
32e5d05328
2 changed files with 6 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package create
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"path"
|
||||
|
|
@ -76,6 +77,10 @@ func NewCmdCreate(f *cmdutil.Factory, runF func(*CreateOptions) error) *cobra.Co
|
|||
return runF(opts)
|
||||
}
|
||||
|
||||
if opts.Template != "" && (opts.Homepage != "" || opts.Team != "" || !opts.EnableIssues || !opts.EnableWiki) {
|
||||
return &cmdutil.FlagError{Err: errors.New(`the '--template' option is not supported with '--homepage, --team, --enable-issues or --enable-wiki'`)}
|
||||
}
|
||||
|
||||
return createRun(opts)
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ type repoTemplateInput struct {
|
|||
OwnerID string `json:"ownerId,omitempty"`
|
||||
|
||||
RepositoryID string `json:"repositoryId,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
}
|
||||
|
||||
// repoCreate creates a new GitHub repository
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue