Skip to content

Commit

Permalink
add version command
Browse files Browse the repository at this point in the history
  • Loading branch information
d-rk committed Dec 12, 2018
1 parent 70770af commit bcbddd4
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
20 changes: 20 additions & 0 deletions cmd/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package cmd

import (
"github.com/deviceinsight/kafkactl/output"
"github.com/spf13/cobra"
)

const VERSION = "0.0.1"

var cmdVersion = &cobra.Command{
Use: "version",
Short: "print the version of kafkactl",
Run: func(cmd *cobra.Command, args []string) {
output.Infof(VERSION)
},
}

func init() {
rootCmd.AddCommand(cmdVersion)
}
14 changes: 14 additions & 0 deletions create_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

version=$1

if [ "$version" == "" ]; then
echo "enter release version:"
read version
fi

version_go="cmd/version.go"

echo "updating $version_go to version $version..."
eval "sed -i 's/const VERSION = .*/const VERSION = \"$version\"/g' $version_go"
echo "done"
1 change: 0 additions & 1 deletion version

This file was deleted.

0 comments on commit bcbddd4

Please sign in to comment.