Categorize Templates as Legacy and NonLegacy
This commit is contained in:
parent
01f272dead
commit
864d74d0b1
5 changed files with 173 additions and 52 deletions
|
|
@ -356,7 +356,7 @@ func issueCreate(cmd *cobra.Command, args []string) error {
|
|||
if baseOverride == "" {
|
||||
if rootDir, err := git.ToplevelDir(); err == nil {
|
||||
// TODO: figure out how to stub this in tests
|
||||
templateFiles = githubtemplate.Find(rootDir, "ISSUE_TEMPLATE")
|
||||
templateFiles = githubtemplate.FindNonLegacy(rootDir, "ISSUE_TEMPLATE")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ func prCreate(cmd *cobra.Command, _ []string) error {
|
|||
var templateFiles []string
|
||||
if rootDir, err := git.ToplevelDir(); err == nil {
|
||||
// TODO: figure out how to stub this in tests
|
||||
templateFiles = githubtemplate.Find(rootDir, "PULL_REQUEST_TEMPLATE")
|
||||
templateFiles = githubtemplate.FindNonLegacy(rootDir, "PULL_REQUEST_TEMPLATE")
|
||||
}
|
||||
|
||||
err := titleBodySurvey(cmd, &tb, client, baseRepo, title, body, defs, templateFiles, true, baseRepo.ViewerCanTriage())
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ type Action int
|
|||
type metadataStateType int
|
||||
|
||||
const (
|
||||
issueMetadata metadataStateType = 0
|
||||
prMetadata metadataStateType = 1
|
||||
issueMetadata metadataStateType = iota
|
||||
prMetadata
|
||||
)
|
||||
|
||||
type issueMetadataState struct {
|
||||
|
|
@ -118,7 +118,7 @@ func selectTemplate(templatePaths []string, metadataType metadataStateType) (str
|
|||
if metadataType == issueMetadata {
|
||||
templateNames = append(templateNames, "Open a blank issue")
|
||||
} else if metadataType == prMetadata {
|
||||
templateNames = append(templateNames, "Open a blank PR")
|
||||
templateNames = append(templateNames, "Open a blank pull request")
|
||||
}
|
||||
|
||||
selectQs := []*survey.Question{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue