Skip to content

Commit

Permalink
Merge pull request #34 from harakeishi/change/release
Browse files Browse the repository at this point in the history
Change/release
  • Loading branch information
harakeishi authored Feb 24, 2022
2 parents 5512394 + c60e948 commit 9aba3d5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"fmt"
"os"
"runtime/debug"

whris "github.com/harakeishi/whris/whris"
"github.com/spf13/cobra"
Expand All @@ -20,7 +21,17 @@ var rootCmd = &cobra.Command{
os.Exit(1)
}
if version {
fmt.Println(Version)
if Version != "dev" {
fmt.Println(Version)

return nil
}
if buildInfo, ok := debug.ReadBuildInfo(); ok {
fmt.Println(buildInfo.Main.Version)

return nil
}
fmt.Println("unknown")
return nil
}
domain := args[0]
Expand Down

0 comments on commit 9aba3d5

Please sign in to comment.