-
Notifications
You must be signed in to change notification settings - Fork 578
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
Houndd version #362
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
48c1801
Add version flag to display vesion of houndd
kartikay-sahaj 2ec131f
Add `VERSION` to Makefile for setting houndd version
kartikay-sahaj 458b696
Add semver versioning allowing versions via build as well
kartikay-sahaj b035aba
Add semvar to go mod
kartikay-sahaj 1b12c06
Merge branch 'master' into houndd-version
kartikay-sahaj 5615d35
Set version to be 0.3.0
kartikay-sahaj 89abcc7
Remove versioning using Makefile
kartikay-sahaj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ package main | |
import ( | ||
"encoding/json" | ||
"flag" | ||
"fmt" | ||
"log" | ||
"net/http" | ||
"os" | ||
|
@@ -13,6 +14,7 @@ import ( | |
"strings" | ||
"syscall" | ||
|
||
"github.com/blang/semver" | ||
"github.com/hound-search/hound/api" | ||
"github.com/hound-search/hound/config" | ||
"github.com/hound-search/hound/searcher" | ||
|
@@ -113,6 +115,14 @@ func runHttp( | |
return http.ListenAndServe(addr, m) | ||
} | ||
|
||
func getVersion() semver.Version { | ||
return semver.Version{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
|
@@ -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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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= |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.