Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
harakeishi committed Feb 24, 2022
1 parent 14c42ee commit 3504702
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: goreleaser

on:
push:
branches:
- main

jobs:
goreleaser:
Expand Down
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 3504702

Please sign in to comment.