Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Houndd version #362

Merged
merged 7 commits into from
Oct 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions cmds/houndd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"encoding/json"
"flag"
"fmt"
"log"
"net/http"
"os"
Expand All @@ -13,6 +14,7 @@ import (
"strings"
"syscall"

"github.com/blang/semver"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we've just added support for gomodules — are you ok with adding this to our go.mod file? I believe you will need to rebase master into this branch and force-push to see it.

"github.com/hound-search/hound/api"
"github.com/hound-search/hound/config"
"github.com/hound-search/hound/searcher"
Expand Down Expand Up @@ -113,6 +115,14 @@ func runHttp(
return http.ListenAndServe(addr, m)
}

func getVersion() semver.Version {
return semver.Version{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The latest release is 0.3.0, technically. Are you seeing v1.0.0 listed somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change it to 0.3.0

Major: 0,
Minor: 3,
Patch: 0,
}
}

func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
info_log = log.New(os.Stdout, "", log.LstdFlags)
Expand All @@ -121,9 +131,15 @@ func main() {
flagConf := flag.String("conf", "config.json", "")
flagAddr := flag.String("addr", ":6080", "")
flagDev := flag.Bool("dev", false, "")
flagVer := flag.Bool("version", false, "Display version and exit")

flag.Parse()

if *flagVer {
fmt.Printf("houndd v%s", getVersion())
os.Exit(0)
}

var cfg config.Config
if err := cfg.LoadFromFile(*flagConf); err != nil {
panic(err)
Expand Down
5 changes: 4 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ module github.com/hound-search/hound

go 1.13

require github.com/go-bindata/go-bindata v3.1.2+incompatible // indirect
require (
github.com/blang/semver v3.5.1+incompatible
github.com/go-bindata/go-bindata v3.1.2+incompatible // indirect
)
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
github.com/blang/semver v1.1.0 h1:ol1rO7QQB5uy7umSNV7VAmLugfLRD+17sYJujRNYPhg=
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/go-bindata/go-bindata v1.0.0 h1:DZ34txDXWn1DyWa+vQf7V9ANc2ILTtrEjtlsdJRF26M=
github.com/go-bindata/go-bindata v3.1.2+incompatible h1:5vjJMVhowQdPzjE1LdxyFF7YFTXg5IgGVW4gBr5IbvE=
github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo=