Version fixes
This commit is contained in:
parent
ce6912047d
commit
e6dd471103
@ -1,7 +1,7 @@
|
|||||||
package build
|
package build
|
||||||
|
|
||||||
// Version is the local build version, set by build system
|
// Version is the local build version, set by build system
|
||||||
const Version = "0.11.0"
|
const Version = "0.1.0"
|
||||||
|
|
||||||
// APIVersion is a hex semver version of the rpc api exposed
|
// APIVersion is a hex semver version of the rpc api exposed
|
||||||
//
|
//
|
||||||
@ -12,15 +12,19 @@ const Version = "0.11.0"
|
|||||||
// R R H
|
// R R H
|
||||||
// |\vv/|
|
// |\vv/|
|
||||||
// vv vv
|
// vv vv
|
||||||
const APIVersion = 0x000b01
|
const APIVersion = 0x000100
|
||||||
|
|
||||||
const (
|
const (
|
||||||
MajorMask = 0xff0000
|
MajorMask = 0xff0000
|
||||||
MinorMask = 0xffff00
|
MinorMask = 0xffff00
|
||||||
PatchMask = 0xffffff
|
PatchMask = 0xffffff
|
||||||
)
|
|
||||||
|
MajorOnlyMask = 0xff0000
|
||||||
|
MinorOnlyMask = 0x00ff00
|
||||||
|
PatchOnlyMask = 0x0000ff
|
||||||
|
c)
|
||||||
|
|
||||||
// VersionInts returns (major, minor, patch) versions
|
// VersionInts returns (major, minor, patch) versions
|
||||||
func VersionInts(version uint32) (uint32, uint32, uint32) {
|
func VersionInts(version uint32) (uint32, uint32, uint32) {
|
||||||
return (version & MajorMask) >> 16, (version & MinorMask) >> 8, version & PatchMask
|
return (version & MajorOnlyMask) >> 16, (version & MinorOnlyMask) >> 8, version & PatchOnlyMask
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,11 @@ var versionCmd = &cli.Command{
|
|||||||
ctx := ReqContext(cctx)
|
ctx := ReqContext(cctx)
|
||||||
// TODO: print more useful things
|
// TODO: print more useful things
|
||||||
|
|
||||||
fmt.Println(api.Version(ctx))
|
v, err := api.Version(ctx)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
fmt.Println(v)
|
||||||
cli.VersionPrinter(cctx)
|
cli.VersionPrinter(cctx)
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user