Skip to content

Commit

Permalink
feat(cli): support env_file
Browse files Browse the repository at this point in the history
  • Loading branch information
fiji-flo committed Dec 17, 2024
1 parent dda87dd commit 2dd18b7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,4 @@ clap-verbosity-flag = { version = "3", features = ["tracing"] }
tabwriter = "1"
axum = "0.7"
tokio = "1"
dotenvy = "0.15"
10 changes: 10 additions & 0 deletions crates/rari-cli/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use std::borrow::Cow;
use std::collections::HashMap;
use std::env;
use std::fs::{self, File};
use std::io::{self, BufWriter, Write};
use std::path::PathBuf;
Expand Down Expand Up @@ -191,6 +193,14 @@ enum Cache {
}

fn main() -> Result<(), Error> {
if let Ok(env_file) = dotenvy::from_filename(
env::var("DOT_FILE")
.map(Cow::Owned)
.unwrap_or(Cow::Borrowed(".env"))
.as_ref(),
) {
println!("Using env_file: {}", env_file.display())
}
let cli = Cli::parse();
if !cli.skip_updates {
rari_deps::webref_css::update_webref_css(rari_types::globals::data_dir())?;
Expand Down

0 comments on commit 2dd18b7

Please sign in to comment.