Skip to content

Commit

Permalink
shared: support runtime configuration for schema lookup (#2657)
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre committed Aug 16, 2021
1 parent e252c2e commit f4efb2c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/shared/build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::collections::hash_map::DefaultHasher;
use std::env;
use std::hash::Hasher;
use std::path::PathBuf;
use std::process::Command;
Expand All @@ -21,7 +22,10 @@ fn main() {
}

fn set_schema_version_env_var() {
let schema_file = PathBuf::from(concat!(env!("CARGO_MANIFEST_DIR"), "/src/lib.rs"));
let cargo_manifest_dir = env::var("CARGO_MANIFEST_DIR").expect(
"The `CARGO_MANIFEST_DIR` environment variable is needed to locate the schema file",
);
let schema_file = PathBuf::from(cargo_manifest_dir).join("src/lib.rs");
let schema_file = std::fs::read(schema_file).unwrap();

let mut hasher = DefaultHasher::new();
Expand Down

0 comments on commit f4efb2c

Please sign in to comment.