Skip to content

Commit

Permalink
Replace dotenv with dotenvy (#107)
Browse files Browse the repository at this point in the history
dotenv appears unmaintained and [does not support multiline
values](dotenv-rs/dotenv#63) yet. Replace this
with a the well maintained fork
[dotenvy](https://crates.io/crates/dotenvy).

## Testing
Ran `scope doctor run` locally and confirmed it successfully reads
multi-line env vars correctly.
  • Loading branch information
noizwaves authored Apr 11, 2024
1 parent 9659e0b commit 20a6288
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
8 changes: 4 additions & 4 deletions 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ lto = "thin"
clap = { version = "4.5.4", features = ["derive", "env"]}
human-panic = "1.2.3"
tokio = { version = "1", features = ["full"] }
dotenv = "0.15.0"
colored = "2.1.0"
which = { version = "6.0", features = ["regex"] }
regex = "1.10.4"
Expand Down Expand Up @@ -78,3 +77,4 @@ octocrab = "0.38.0"
jsonwebtoken = "9.3.0"
secrecy = "0.8.0"
url = "2.5.0"
dotenvy = "0.15.7"
2 changes: 1 addition & 1 deletion scope/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ name = "scope-intercept"
clap.workspace = true
human-panic.workspace = true
tokio.workspace = true
dotenv.workspace = true
colored.workspace = true
which.workspace = true
regex.workspace = true
Expand Down Expand Up @@ -72,6 +71,7 @@ octocrab.workspace = true
jsonwebtoken.workspace = true
secrecy.workspace = true
url.workspace = true
dotenvy.workspace = true

[dev-dependencies]
assert_cmd = "2.0.14"
Expand Down
4 changes: 2 additions & 2 deletions scope/src/bin/scope-intercept.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ struct Cli {
#[tokio::main]
async fn main() -> anyhow::Result<()> {
setup_panic!();
dotenv::dotenv().ok();
dotenvy::dotenv().ok();
let exe_path = std::env::current_exe().unwrap();
let env_path = exe_path.parent().unwrap().join("../etc/scope.env");
dotenv::from_path(env_path).ok();
dotenvy::from_path(env_path).ok();
let opts = Cli::parse();

let (_guard, file_location) = opts
Expand Down
5 changes: 3 additions & 2 deletions scope/src/bin/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ enum Command {
#[tokio::main]
async fn main() {
setup_panic!();
dotenv::dotenv().ok();
dotenvy::dotenv().ok();
let exe_path = std::env::current_exe().unwrap();
let env_path = exe_path.parent().unwrap().join("../etc/scope.env");
dotenv::from_path(env_path).ok();
dotenvy::from_path(env_path).ok();
dbg!(dotenvy::vars());
let opts = Cli::parse();

let (_guard, file_location) = opts
Expand Down

0 comments on commit 20a6288

Please sign in to comment.