File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ clarity = { path = "../clarity" }
25
25
clap = { version = " 4.1.1" , features = [" derive" , " env" ] }
26
26
hashbrown = { workspace = true }
27
27
lazy_static = " 1.4.0"
28
+ once_cell = " 1.8.0"
28
29
libsigner = { path = " ../libsigner" }
29
30
libstackerdb = { path = " ../libstackerdb" }
30
31
prometheus = { version = " 0.9" , optional = true }
Original file line number Diff line number Diff line change @@ -37,12 +37,36 @@ use stacks_common::address::{
37
37
} ;
38
38
use stacks_common:: define_u8_enum;
39
39
use stacks_common:: types:: chainstate:: StacksPrivateKey ;
40
+ use once_cell:: sync:: Lazy ;
40
41
41
42
extern crate alloc;
42
43
44
+ const GIT_BRANCH : Option < & ' static str > = option_env ! ( "GIT_BRANCH" ) ;
45
+ const GIT_COMMIT : Option < & ' static str > = option_env ! ( "GIT_COMMIT" ) ;
46
+ #[ cfg( debug_assertions) ]
47
+ const BUILD_TYPE : & ' static str = "debug" ;
48
+ #[ cfg( not( debug_assertions) ) ]
49
+ const BUILD_TYPE : & ' static str = "release" ;
50
+
51
+
52
+ static VERSION_STRING : Lazy < String > = Lazy :: new ( || {
53
+ let pkg_version = option_env ! ( "STACKS_NODE_VERSION" ) . unwrap_or ( env ! ( "CARGO_PKG_VERSION" ) ) ;
54
+ let git_branch = GIT_BRANCH . unwrap_or ( "" ) ;
55
+ let git_commit = GIT_COMMIT . unwrap_or ( "" ) ;
56
+ format ! (
57
+ "{} ({}:{}, {} build, {} [{}])" ,
58
+ pkg_version,
59
+ git_branch,
60
+ git_commit,
61
+ BUILD_TYPE ,
62
+ std:: env:: consts:: OS ,
63
+ std:: env:: consts:: ARCH
64
+ )
65
+ } ) ;
66
+
43
67
#[ derive( Parser , Debug ) ]
44
68
#[ command( author, version, about) ]
45
- #[ command( long_version = option_env! ( "SIGNER_VERSION" ) . unwrap_or ( env! ( "CARGO_PKG_VERSION" ) ) ) ]
69
+ #[ command( long_version = VERSION_STRING . as_str ( ) ) ]
46
70
47
71
/// The CLI arguments for the stacks signer
48
72
pub struct Cli {
You can’t perform that action at this time.
0 commit comments