This repository has been archived on 2024-06-07. You can view files and clone it, but cannot push or open issues or pull requests.
ux-survey/build.rs
Aravinth Manivannan 89e26de87d
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
feat: bootstrap survey from showcase
2024-01-31 15:22:39 +05:30

22 lines
721 B
Rust

// Copyright (C) 2021 Aravinth Manivannan <realaravinth@batsense.net>
// SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
use std::process::Command;
use sqlx::types::time::OffsetDateTime;
fn main() {
// note: add error checking yourself.
let output = Command::new("git")
.args(["rev-parse", "HEAD"])
.output()
.unwrap();
let git_hash = String::from_utf8(output.stdout).unwrap();
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
let now = OffsetDateTime::now_utc();
let now = format!("{}{}{}", now.year(), now.month(), now.date());
println!("cargo:rustc-env=COMPILED_DATE={}", &now);
}