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 3bbaf5ea045447a8f8ef3c37693bf870921da82e 670 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=gitrs.service");
8
9
    // When running `cargo install` (release profile) with permissions to write to
10
    // /etc/systemd/system, automatically install gitrs.service.
11
    if std::env::var("PROFILE").as_deref() == Ok("release") {
12
        let _ = std::fs::copy("gitrs.service", "/etc/systemd/system/gitrs.service");
13
    }
14
}