Include git hash in version
This commit is contained in:
parent
6a64bd2e47
commit
9b55cd1ce2
4 changed files with 76 additions and 2 deletions
16
src/main.rs
16
src/main.rs
|
|
@ -7,9 +7,19 @@ use axum::{extract::State, http::StatusCode, routing::get, Router};
|
|||
use clap::Parser;
|
||||
use sqlx::SqlitePool;
|
||||
use state::AppState;
|
||||
use tracing::info;
|
||||
use tracing_subscriber::filter::LevelFilter;
|
||||
|
||||
const NAME: &str = env!("CARGO_PKG_NAME");
|
||||
const VERSION: &str = concat!(
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
" (",
|
||||
env!("VERGEN_GIT_DESCRIBE"),
|
||||
")"
|
||||
);
|
||||
|
||||
#[derive(Debug, clap::Parser)]
|
||||
#[command(name = NAME, version = VERSION)]
|
||||
struct Args {}
|
||||
|
||||
fn set_up_logging() {
|
||||
|
|
@ -37,9 +47,11 @@ async fn index(State(db): State<SqlitePool>) -> Result<Response, Response> {
|
|||
}
|
||||
|
||||
async fn run() -> anyhow::Result<()> {
|
||||
set_up_logging();
|
||||
|
||||
let args = Args::parse();
|
||||
|
||||
set_up_logging();
|
||||
info!("You are running {NAME} {VERSION}");
|
||||
|
||||
let state = AppState::new().await?;
|
||||
|
||||
let app = Router::new()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue