Print the version on lift off

This commit is contained in:
Paul van Tilburg 2023-05-29 15:32:17 +02:00 committed by Paul van Tilburg
parent ab6001f072
commit 7c2b012e95
1 changed files with 9 additions and 0 deletions

View File

@ -166,6 +166,15 @@ fn rocket(maps_handle: MapsHandle) -> Rocket<Build> {
let _refresher = rocket::tokio::spawn(maps_refresher);
})
}))
.attach(AdHoc::on_liftoff("Version", |_| {
Box::pin(async move {
let name = env!("CARGO_PKG_NAME");
let version = env!("CARGO_PKG_VERSION");
let git_sha = &env!("VERGEN_GIT_SHA")[0..7];
println!("🌁 Started {name} v{version} (git @{git_sha})");
})
}))
}
/// Sets up Rocket and the maps cache refresher task.