2023-06-26 13:59:03 +05:30
|
|
|
// Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
|
|
|
|
// SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2021-07-21 22:15:52 +05:30
|
|
|
use std::process::Command;
|
2021-03-24 12:43:32 +05:30
|
|
|
|
2021-07-21 22:15:52 +05:30
|
|
|
use sqlx::types::time::OffsetDateTime;
|
2021-04-01 15:23:36 +05:30
|
|
|
|
2021-03-24 12:43:32 +05:30
|
|
|
fn main() {
|
|
|
|
// note: add error checking yourself.
|
|
|
|
let output = Command::new("git")
|
2023-07-02 21:51:24 +05:30
|
|
|
.args(["rev-parse", "HEAD"])
|
2021-03-24 12:43:32 +05:30
|
|
|
.output()
|
|
|
|
.unwrap();
|
|
|
|
let git_hash = String::from_utf8(output.stdout).unwrap();
|
|
|
|
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
|
2021-04-01 15:23:36 +05:30
|
|
|
|
2023-10-16 21:11:04 +05:30
|
|
|
let now = OffsetDateTime::now_utc();
|
|
|
|
let now = format!("{}{}{}", now.year(), now.month(), now.date());
|
2021-07-21 22:15:52 +05:30
|
|
|
println!("cargo:rustc-env=COMPILED_DATE={}", &now);
|
2021-03-24 12:43:32 +05:30
|
|
|
}
|