mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08:00
Unwrap or unknown the commit hash
This commit is contained in:
parent
1782753387
commit
a8c146fd13
@ -1,7 +1,9 @@
|
|||||||
use vergen::{vergen, Config};
|
use vergen::{vergen, Config};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
vergen(Config::default()).unwrap();
|
if let Err(e) = vergen(Config::default()) {
|
||||||
|
println!("cargo:warning=vergen: {}", e);
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "mini-dashboard")]
|
#[cfg(feature = "mini-dashboard")]
|
||||||
mini_dashboard::setup_mini_dashboard().expect("Could not load the mini-dashboard assets");
|
mini_dashboard::setup_mini_dashboard().expect("Could not load the mini-dashboard assets");
|
||||||
|
@ -104,14 +104,8 @@ async fn run_http(data: Data, opt: Opt) -> Result<(), Box<dyn std::error::Error>
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn print_launch_resume(opt: &Opt, data: &Data) {
|
pub fn print_launch_resume(opt: &Opt, data: &Data) {
|
||||||
let commit_sha = match option_env!("COMMIT_SHA") {
|
let commit_sha = option_env!("VERGEN_GIT_SHA").unwrap_or("unknown");
|
||||||
Some("") | None => env!("VERGEN_GIT_SHA"),
|
let commit_date = option_env!("VERGEN_GIT_COMMIT_TIMESTAMP").unwrap_or("unknown");
|
||||||
Some(commit_sha) => commit_sha,
|
|
||||||
};
|
|
||||||
let commit_date = match option_env!("COMMIT_DATE") {
|
|
||||||
Some("") | None => env!("VERGEN_GIT_COMMIT_TIMESTAMP"),
|
|
||||||
Some(commit_date) => commit_date,
|
|
||||||
};
|
|
||||||
|
|
||||||
let ascii_name = r#"
|
let ascii_name = r#"
|
||||||
888b d888 d8b 888 d8b .d8888b. 888
|
888b d888 d8b 888 d8b .d8888b. 888
|
||||||
|
@ -245,14 +245,8 @@ struct VersionResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn get_version(_data: GuardedData<Private, Data>) -> HttpResponse {
|
async fn get_version(_data: GuardedData<Private, Data>) -> HttpResponse {
|
||||||
let commit_sha = match option_env!("COMMIT_SHA") {
|
let commit_sha = option_env!("VERGEN_GIT_SHA").unwrap_or("unknown");
|
||||||
Some("") | None => env!("VERGEN_GIT_SHA"),
|
let commit_date = option_env!("VERGEN_GIT_COMMIT_TIMESTAMP").unwrap_or("unknown");
|
||||||
Some(commit_sha) => commit_sha,
|
|
||||||
};
|
|
||||||
let commit_date = match option_env!("COMMIT_DATE") {
|
|
||||||
Some("") | None => env!("VERGEN_GIT_COMMIT_TIMESTAMP"),
|
|
||||||
Some(commit_date) => commit_date,
|
|
||||||
};
|
|
||||||
|
|
||||||
HttpResponse::Ok().json(VersionResponse {
|
HttpResponse::Ok().json(VersionResponse {
|
||||||
commit_sha: commit_sha.to_string(),
|
commit_sha: commit_sha.to_string(),
|
||||||
|
Loading…
Reference in New Issue
Block a user