parse flags from env blocks patch
This commit is contained in:
@ -58,10 +58,17 @@ fn parse_env_vars(content: &str) -> HashMap<String, String> {
|
||||
.lines()
|
||||
.filter_map(|line| {
|
||||
let line = line.trim();
|
||||
if line.is_empty() || line.starts_with('#') { return None }
|
||||
if line.is_empty() || line.starts_with('#') {
|
||||
return None;
|
||||
}
|
||||
|
||||
let parts: Vec<&str> = line.splitn(2, '=').collect();
|
||||
if parts.len() != 2 { return None }
|
||||
Some((parts[0].to_string(), parts[1].to_string()))
|
||||
|
||||
match parts.len() {
|
||||
2 => Some((parts[0].to_string(), parts[1].to_string())),
|
||||
1 => Some((parts[0].to_string(), String::new())),
|
||||
_ => None,
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user