index : gitrs
A lightweight web interface for browsing Git repositories, implemented in Rust
about summary refs log tree commit diff
gitrs / build.rs
-rw-r--r-- blob 70178a3d906ca8eb11eb215106751d5bf750e9e6 674 bytes (plain)
1
fn main() {
2
    // Cargo watches these directories recursively; any file added/changed/removed
3
    // under them triggers a rebuild on the next `cargo build`/`cargo run`.
4
    println!("cargo:rerun-if-changed=src");
5
    println!("cargo:rerun-if-changed=templates");
6
    println!("cargo:rerun-if-changed=static");
7
    println!("cargo:rerun-if-changed=git-rs.service");
8
9
    // When running `cargo install` (release profile) with permissions to write to
10
    // /etc/systemd/system, automatically install git-rs.service.
11
    if std::env::var("PROFILE").as_deref() == Ok("release") {
12
        let _ = std::fs::copy("git-rs.service", "/etc/systemd/system/git-rs.service");
13
    }
14
}