Skip to content

Commit 6143178

Browse files
committed
chore(release): v0.1.2
1 parent 8f3a6d8 commit 6143178

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,7 @@ You will be prompted for selecting/entering each commit message component.
103103
> coming soon
104104
105105
## Reference
106-
* [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/)
106+
* [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/)
107+
* [Cobra](https://github.com/spf13/cobra)
108+
* [Survey](https://github.com/AlecAivazis/survey)
109+
* [Carbon](https://carbon.now.sh/)

cmd/root.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ import (
1010
"github.com/spf13/viper"
1111
)
1212

13+
// VersionTmpl version template for --version output
14+
const VersionTmpl = `
15+
{{- .Name}} {{.Version}}
16+
`
17+
1318
var (
1419
cfgFile string
1520
isVerbose bool
@@ -20,7 +25,7 @@ var logger *util.Logger = util.InitLogger(os.Stdout, os.Stdout, os.Stdout, os.St
2025
// rootCmd represents the base command when called without any subcommands
2126
var rootCmd = &cobra.Command{
2227
Use: "gitwok",
23-
Version: "v0.1.0",
28+
Version: "v0.1.2",
2429
Short: "Configurable CLI with conventional commits, changelog, git hooks all in one",
2530
Run: func(cmd *cobra.Command, args []string) {},
2631
}
@@ -34,7 +39,7 @@ func Execute() {
3439
func init() {
3540
cobra.OnInitialize(initConfig)
3641

37-
rootCmd.SetVersionTemplate("{{.Name}} {{.Version}}\n")
42+
rootCmd.SetVersionTemplate(VersionTmpl)
3843

3944
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is ./gitwok.yaml)")
4045
rootCmd.PersistentFlags().BoolVarP(&isVerbose, "verbose", "v", false, "verbose output")
@@ -65,11 +70,11 @@ func initConfig() {
6570
logger.Verbose("Using config file", viper.ConfigFileUsed())
6671
} else {
6772
if fnfe, ok := err.(viper.ConfigFileNotFoundError); ok {
68-
logger.Error(fnfe)
73+
logger.Warn(fnfe)
6974
} else if pe, ok := err.(viper.ConfigParseError); ok {
70-
logger.Error(pe)
75+
logger.Warn(pe)
7176
} else {
72-
logger.Error(err)
77+
logger.Warn(err)
7378
}
7479
}
7580
}

cmd/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ func init() {
2222
}
2323

2424
func printlnVer(name string, semver string) {
25-
fmt.Printf("%s %s\n", name, semver)
25+
fmt.Print(fmt.Sprintln(name, semver))
2626
}

0 commit comments

Comments
 (0)