Skip to content

Commit

Permalink
remove dotfile change
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-aranha-cw committed Aug 1, 2024
1 parent 5ae248a commit 224d53d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
10 changes: 0 additions & 10 deletions config/stratus-follower.env.local

This file was deleted.

2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ stratus *args="":

# Bin: Stratus main service as follower
stratus-follower *args="":
LOCAL_ENV_PATH=stratus-follower cargo {{nightly_flag}} run --bin stratus {{release_flag}} --features dev -- --follower {{args}}
cargo {{nightly_flag}} run --bin stratus {{release_flag}} --features dev -- --follower --external-rpc http://spec.testnet.cloudwalk.network:9934/ --external-rpc-ws ws://spec.testnet.cloudwalk.network:9946/ {{args}}

# Bin: Download external RPC blocks and receipts to temporary storage
rpc-downloader *args="":
Expand Down
15 changes: 4 additions & 11 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,16 @@ pub fn load_dotenv() {
Ok(env) => Environment::from_str(env.as_str()),
Err(_) => Ok(Environment::Local),
};

// determine the .env file to load
let env_filename = match env {
Ok(Environment::Local) => {
// local environment only
match std::env::var("LOCAL_ENV_PATH") {
Ok(local_path) => format!("config/{}.env.local", local_path),
Err(_) => format!("config/{}.env.local", build_info::binary_name()),
}
}
Ok(env) => format!("config/{}.env.{}", build_info::binary_name(), env),
let env = match env {
Ok(env) => env,
Err(e) => {
println!("{e}");
return;
}
};

// load .env file
let env_filename = format!("config/{}.env.{}", build_info::binary_name(), env);
println!("reading env file | filename={}", env_filename);

if let Err(e) = dotenvy::from_filename(env_filename) {
Expand Down

0 comments on commit 224d53d

Please sign in to comment.