mirror of
https://github.com/netfun2000/rttys_zhaojh329.git
synced 2026-02-27 09:53:24 +08:00
@@ -31,6 +31,7 @@ import (
|
||||
"encoding/json"
|
||||
_ "github.com/zhaojh329/rttys/statik"
|
||||
"github.com/rakyll/statik/fs"
|
||||
"github.com/zhaojh329/rttys/version"
|
||||
)
|
||||
|
||||
type DeviceInfo struct {
|
||||
@@ -55,6 +56,9 @@ func main() {
|
||||
|
||||
rand.Seed(time.Now().Unix())
|
||||
|
||||
log.Println("BuildDate:", version.BuildDate)
|
||||
log.Println("Gitref:", version.Gitref)
|
||||
|
||||
br := newBridge()
|
||||
go br.run()
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
BUILDDATE=`date +%F`
|
||||
GITREF=`git describe --always --tags --long`
|
||||
|
||||
# $(VERSION_GO) will be written to version.go
|
||||
VERSION_GO="/* DO NOT EDIT THIS FILE. IT IS GENERATED BY 'make'*/\n\
|
||||
package version\n\
|
||||
var Gitref, BuildDate string\n"
|
||||
|
||||
# $(GIT_GO) will be written to gitref.go
|
||||
GITREF_GO="/* DO NOT EDIT THIS FILE. IT IS GENERATED BY make */ \n\n\
|
||||
package version\n\
|
||||
func init() { Gitref = \"$(GITREF)\"\nBuildDate= \"$(BUILDDATE)\"\n} "
|
||||
|
||||
#
|
||||
# setver updates version.go with VERSION
|
||||
#
|
||||
.PHONY:setver
|
||||
setver:
|
||||
@printf $(VERSION_GO) | gofmt > version.go
|
||||
@printf $(GITREF_GO) | gofmt > git.go
|
||||
@@ -0,0 +1,8 @@
|
||||
/* DO NOT EDIT THIS FILE. IT IS GENERATED BY make */
|
||||
|
||||
package version
|
||||
|
||||
func init() {
|
||||
Gitref = "0079594-dirty"
|
||||
BuildDate = "2018-03-14"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
/* DO NOT EDIT THIS FILE. IT IS GENERATED BY 'make'*/
|
||||
package version
|
||||
|
||||
var Gitref, BuildDate string
|
||||
Reference in New Issue
Block a user