From 75b6382e73aaa8f1e3a1a97770924c159c19084a Mon Sep 17 00:00:00 2001 From: ipanardian Date: Sun, 12 May 2019 22:03:24 +0700 Subject: [PATCH 1/2] Change default type convention to forward slash --- core/app.go | 4 ++-- core/branch.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/app.go b/core/app.go index f69c0e8..c79ffd8 100644 --- a/core/app.go +++ b/core/app.go @@ -42,12 +42,12 @@ func SetFlags(app *cli.App) { app.Flags = []cli.Flag{ cli.StringFlag{ Name: "tc", - Value: "_", + Value: "", Usage: "Set type convention ('/', '-', '_'). e.g feature/{branch}, feature-{branch} or feature_{branch}", }, cli.StringFlag{ Name: "nc", - Value: "snake", + Value: "", Usage: "Set naming convention ('snake', 'kebab'). e.g branch_name or branch-name", }, } diff --git a/core/branch.go b/core/branch.go index 912d0b8..3adaa58 100644 --- a/core/branch.go +++ b/core/branch.go @@ -67,7 +67,7 @@ var typeConvention = TypeConvention{ } //Default TC -var typeConventionSelected = typeConvention.Underscore +var typeConventionSelected = typeConvention.ForwardSlash //namingConvention values var namingConvention = NamingConvention{ From 33dfa9f9cae4eb8cf35054629b4e8def3d2ae58a Mon Sep 17 00:00:00 2001 From: ipanardian Date: Sun, 12 May 2019 22:19:37 +0700 Subject: [PATCH 2/2] Add new 'release' prefix --- core/app.go | 2 +- core/ask.go | 2 +- core/branch.go | 30 +++++++++++++++--------------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/core/app.go b/core/app.go index c79ffd8..2dfcf60 100644 --- a/core/app.go +++ b/core/app.go @@ -33,7 +33,7 @@ func InitializeApp(app *cli.App) { app.Name = "GoBranch" app.Usage = "A command line app to help you quickly creating git branch without hassle step." app.UsageText = "Just type gobranch" - app.Version = "0.0.0.1" + app.Version = "0.1.0.0" app.Author = "Ipan Ardian " } diff --git a/core/ask.go b/core/ask.go index 4eaf8fd..578d67a 100644 --- a/core/ask.go +++ b/core/ask.go @@ -50,8 +50,8 @@ func getBranchTypeQuestion(branchType BranchType) []*survey.Question { branchType.Enhance, branchType.Bugfix, branchType.Hotfix, - branchType.Hotfeature, branchType.Test, + branchType.Release, branchType.Custom, }, Default: "Feature", diff --git a/core/branch.go b/core/branch.go index 3adaa58..1e7ce13 100644 --- a/core/branch.go +++ b/core/branch.go @@ -34,13 +34,13 @@ import ( //BranchType List predefined of BranchType type BranchType struct { - Feature string - Enhance string - Bugfix string - Hotfix string - Hotfeature string - Test string - Custom string + Feature string + Enhance string + Bugfix string + Hotfix string + Test string + Release string + Custom string } //BranchTypeMap Collection of base branch @@ -84,20 +84,20 @@ var branchType = BranchType{ "enhance", "bugfix", "hotfix", - "hotfeature", "test", + "release", "custom", } //branchTypeMap Init branchTypeMap var branchTypeMap = BranchTypeMap{ - branchType.Feature: "development", - branchType.Enhance: "development", - branchType.Bugfix: "development", - branchType.Hotfix: "hotfix", - branchType.Hotfeature: "hotfix", - branchType.Test: "development", - branchType.Custom: "", + branchType.Feature: "development", + branchType.Enhance: "development", + branchType.Bugfix: "development", + branchType.Hotfix: "hotfix", + branchType.Test: "development", + branchType.Release: "master", + branchType.Custom: "", } //createBranchName Transform branch name