fix: pass full env file path

This commit is contained in:
əlemi 2024-10-30 02:37:45 +01:00
parent cb225ae7de
commit 324b7ce705
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -24,8 +24,8 @@ struct PostWomanArgs {
collection: std::path::PathBuf,
/// environment (.env) to load
#[arg(short, long, default_value = "")]
env: String,
#[arg(short, long, default_value = ".env")]
env: std::path::PathBuf,
/// action to run
#[clap(subcommand)]
@ -92,8 +92,8 @@ fn main() {
PostWomanActions::Run { query, parallel, debug, dry_run } => {
eprintln!("~@ {APP_USER_AGENT}");
if let Err(e) = dotenv::from_filename(format!("{}.env", args.env)) {
eprintln!(" ! error loading env file: {e}");
if dotenv::from_path(&args.env).is_ok() {
eprintln!(" # loaded env file {:?}", args.env);
}
// note that if you remove this test, there's another .expect() below you need to manage too!