aboutsummaryrefslogtreecommitdiff
path: root/src/garage/main.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-09-07 18:30:15 +0200
committerAlex Auvolat <alex@adnab.me>2022-09-07 18:30:15 +0200
commitf310fce34b0273f9f75e7a6ea665f51003a1f795 (patch)
tree9480af39147f396f36fb8d73241ebcda6a468d4b /src/garage/main.rs
parent06df301de5ab2068ee55c8663eebafb0d9a26978 (diff)
downloadgarage-f310fce34b0273f9f75e7a6ea665f51003a1f795.tar.gz
garage-f310fce34b0273f9f75e7a6ea665f51003a1f795.zip
Inject GIT_VERSION even later
Diffstat (limited to 'src/garage/main.rs')
-rw-r--r--src/garage/main.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/garage/main.rs b/src/garage/main.rs
index 751dd941..1a4a939a 100644
--- a/src/garage/main.rs
+++ b/src/garage/main.rs
@@ -77,7 +77,7 @@ async fn main() {
std::process::abort();
}));
- // Parse opt
+ // Initialize version and features info
let features = &[
#[cfg(feature = "k2v")]
"k2v",
@@ -98,12 +98,17 @@ async fn main() {
#[cfg(feature = "system-libs")]
"system-libs",
][..];
+ if let Some(git_version) = option_env!("GIT_VERSION") {
+ garage_model::version::init_version(git_version);
+ }
+ garage_model::version::init_features(features);
+
+ // Parse arguments
let version = format!(
"{} [features: {}]",
garage_model::version::garage_version(),
features.join(", ")
);
- garage_model::version::init_features(features);
let opt = Opt::from_clap(&Opt::clap().version(version.as_str()).get_matches());
let res = match opt.cmd {