fix: make path to env files depend of the CARGO_MANIFEST_DIR of sesam-vitale crate

This commit is contained in:
2024-07-27 00:31:01 +02:00
parent a194b2d888
commit 9fc3fef350
2 changed files with 12 additions and 6 deletions

View File

@ -3,9 +3,9 @@ extern crate dotenv;
use libc::{ c_char, c_void, c_ushort, size_t };
use std::ffi::CString;
use std::path::PathBuf;
use std::ptr;
use dotenv::dotenv;
use std::env;
extern "C" {
@ -72,7 +72,9 @@ fn ssv_lire_config() {
}
pub fn demo() {
dotenv().ok();
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
let manifest_path = PathBuf::from(manifest_dir);
dotenv::from_path(manifest_path.join(".env")).ok();
println!("------- Demo for the SSV library --------");