Open darrylwest opened 11 months ago
another idea would be to look at the binary path; if it's in the repo space, like replica/target/debug/replica then it's test;o
match env::current_exe() {
Ok(exe_path) => println!("Path of this executable is: {}", exe_path.display()),
Err(e) => println!("failed to get current exe path: {e}"),
}
might be better to locate the config files in ~/.config/replica/config.toml as the runtime default. that way, an env var like REPLICA_HOME would specify there the app would run, then set it to the repo folder for tests so that the tests don't break. in production, it looks for REPLICA_HOME but uses the default user $HOME when not set.