Skip to content

Commit

Permalink
build: Use CARGO_MANIFEST_DIR and decrease scope of files
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric authored and joaoantoniocardoso committed Oct 27, 2024
1 parent 8b8c208 commit e31cce8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use std::process::{exit, Command};
use std::{
env,
path::Path,
process::{exit, Command},
};

use vergen_gix::{BuildBuilder, CargoBuilder, DependencyKind, GixBuilder};

Expand Down Expand Up @@ -64,7 +68,11 @@ fn install_trunk() -> Result<(), Box<dyn std::error::Error>> {
}

fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("cargo:rerun-if-changed=./src/webpage/");
let out_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
for path in ["src", "assets", "index.html"].iter() {
let p = Path::new(&out_dir).join(format!("src/webpage/{}", path));
println!("cargo:rerun-if-changed={}", p.display());
}

vergen_gix::Emitter::default()
.add_instructions(&BuildBuilder::all_build()?)?
Expand Down

0 comments on commit e31cce8

Please sign in to comment.