index : gitrs
A lightweight web interface for browsing Git repositories, implemented in Rust
about summary refs log tree commit diff

Diffstat (limited to 'build.rs')

-rw-r--r-- build.rs 7
 1 file changed, 7 insertions(+)

diff --git a/build.rs b/build.rs
index fe7e164..70178a3 100644
--- a/build.rs
+++ b/build.rs
@@ -4,4 +4,11 @@
    println!("cargo:rerun-if-changed=src");
    println!("cargo:rerun-if-changed=templates");
    println!("cargo:rerun-if-changed=static");
    println!("cargo:rerun-if-changed=git-rs.service");

    // When running `cargo install` (release profile) with permissions to write to
    // /etc/systemd/system, automatically install git-rs.service.
    if std::env::var("PROFILE").as_deref() == Ok("release") {
        let _ = std::fs::copy("git-rs.service", "/etc/systemd/system/git-rs.service");
    }
}