fix: pass full env file path
This commit is contained in:
parent
cb225ae7de
commit
324b7ce705
1 changed files with 4 additions and 4 deletions
|
@ -24,8 +24,8 @@ struct PostWomanArgs {
|
||||||
collection: std::path::PathBuf,
|
collection: std::path::PathBuf,
|
||||||
|
|
||||||
/// environment (.env) to load
|
/// environment (.env) to load
|
||||||
#[arg(short, long, default_value = "")]
|
#[arg(short, long, default_value = ".env")]
|
||||||
env: String,
|
env: std::path::PathBuf,
|
||||||
|
|
||||||
/// action to run
|
/// action to run
|
||||||
#[clap(subcommand)]
|
#[clap(subcommand)]
|
||||||
|
@ -92,8 +92,8 @@ fn main() {
|
||||||
PostWomanActions::Run { query, parallel, debug, dry_run } => {
|
PostWomanActions::Run { query, parallel, debug, dry_run } => {
|
||||||
eprintln!("~@ {APP_USER_AGENT}");
|
eprintln!("~@ {APP_USER_AGENT}");
|
||||||
|
|
||||||
if let Err(e) = dotenv::from_filename(format!("{}.env", args.env)) {
|
if dotenv::from_path(&args.env).is_ok() {
|
||||||
eprintln!(" ! error loading env file: {e}");
|
eprintln!(" # loaded env file {:?}", args.env);
|
||||||
}
|
}
|
||||||
|
|
||||||
// note that if you remove this test, there's another .expect() below you need to manage too!
|
// note that if you remove this test, there's another .expect() below you need to manage too!
|
||||||
|
|
Loading…
Reference in a new issue