build(travis): add release config

This commit is contained in:
Nightapes
2019-06-18 21:35:51 +02:00
parent f65b90975f
commit 7de6f249fe
7 changed files with 17 additions and 12 deletions

View File

@@ -7,8 +7,6 @@ import (
func init() {
rootCmd.AddCommand(releaseCmd)
releaseCmd.Flags().BoolP("force", "f", false, "")
}
var releaseCmd = &cobra.Command{
@@ -25,7 +23,7 @@ var releaseCmd = &cobra.Command{
return err
}
force, err := cmd.Flags().GetBool("force")
force, err := cmd.Flags().GetBool("no-cache")
if err != nil {
return err
}

View File

@@ -23,7 +23,8 @@ var rootCmd = &cobra.Command{
}
//Execute rootCmd
func Execute() {
func Execute(version string) {
rootCmd.Version = version
if err := rootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)

View File

@@ -4,6 +4,8 @@ import (
"github.com/Nightapes/go-semantic-release/cmd/go-semantic-release/commands"
)
var version string
func main() {
commands.Execute()
commands.Execute(version)
}