info: expose current head as version
- Id
- a42d4e64b15d4c77cae1394dd52c6e28e3818ee1
- Author
- Caio
- Commit time
- 2025-12-03T09:16:35+01:00
Modified moros/README
cargo run -- cli /path/to/dataset-dir <POSTCODE|OFFSET|<LATITUDE LONGITUDE>>
+DEPLOY
+
+ GIT_VERSION=$(git describe --always --dirty) cargo build --release
+
REGEN POSTCODE FST
# data at https://github.com/caio/netherlands-postcode-geojson
Modified moros/src/ui.rs
}
}
+const VERSION: Option<&str> = option_env!("GIT_VERSION");
+
#[derive(Template)]
#[template(path = "info.html.jinja")]
pub struct Info<'a> {
age: Minutes,
kind: ModelKind,
status: &'static str,
+ version: &'static str,
}
impl<'a> Info<'a> {
dataset,
status,
kind: moros.kind(),
+ version: VERSION.unwrap_or("Unknown"),
}
}
Modified moros/templates/info.html.jinja
<div class="center">{{ status }}</div>
<ul class="small">
+<li>Version: {{ version }}</li>
<li>File: {{ dataset }}</li>
<li>Kind: {{ kind }}</li>
<li>Age: {{ age }}</li>