Skip to content

Commit

Permalink
Allow providing custom path for .env (#1370)
Browse files Browse the repository at this point in the history
  • Loading branch information
spetz authored Dec 1, 2024
1 parent 700fe38 commit f052350
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "server"
version = "0.4.83"
version = "0.4.84"
edition = "2021"
build = "src/build.rs"

Expand Down
6 changes: 5 additions & 1 deletion server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ async fn main() -> Result<(), ServerError> {
let figure = standard_font.convert("Iggy Server");
println!("{}", figure.unwrap());

if let Ok(path) = dotenv() {
if let Ok(env_path) = std::env::var("IGGY_ENV_PATH") {
if dotenvy::from_path(&env_path).is_ok() {
println!("Loaded environment variables from path: {env_path}");
}
} else if let Ok(path) = dotenv() {
println!(
"Loaded environment variables from .env file at path: {}",
path.display()
Expand Down

0 comments on commit f052350

Please sign in to comment.