Skip to content

Commit

Permalink
fix: Make whitespace around env vars optional
Browse files Browse the repository at this point in the history
  • Loading branch information
stevensdavid committed Jun 10, 2024
1 parent ddc9f3b commit 7bd7ef5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub async fn load_config<P: Into<PathBuf>>(path: P) -> Result<Config, Box<dyn st
}

pub fn replace_env_vars(content: &str) -> String {
let re = regex::Regex::new(r"\$\{\{\s+env\.(.*?)\s+\}\}").unwrap();
let re = regex::Regex::new(r"\$\{\{\s*env\.(.*?)\s*\}\}").unwrap();
let replaced = re.replace_all(content, |caps: &regex::Captures| {
let var_name = &caps[1];
// panics on missing enivronment variables, probably desirable?
Expand Down

0 comments on commit 7bd7ef5

Please sign in to comment.