Rendre le système de fichier de configuration runtime fonctionnel en dev et en release #56
@ -1,13 +1,13 @@
|
|||||||
extern crate dotenv;
|
|
||||||
|
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
|
use dotenv::from_path;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Load the .env.build file for build-time environment variables
|
// Load the .env.build file for build-time environment variables
|
||||||
let manifest_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR must be set");
|
let manifest_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR must be set");
|
||||||
let manifest_path = PathBuf::from(manifest_dir);
|
let manifest_path = PathBuf::from(manifest_dir);
|
||||||
dotenv::from_path(manifest_path.join(".env.build")).ok();
|
from_path(manifest_path.join(".env.build")).ok();
|
||||||
|
|
||||||
println!("cargo::rerun-if-env-changed=SESAM_FSV_LIB_PATH");
|
println!("cargo::rerun-if-env-changed=SESAM_FSV_LIB_PATH");
|
||||||
println!("cargo::rerun-if-env-changed=SESAM_FSV_SSVLIB");
|
println!("cargo::rerun-if-env-changed=SESAM_FSV_SSVLIB");
|
||||||
|
Loading…
Reference in New Issue
Block a user