Skip to content

Commit

Permalink
fix: allow environment overwrites when using built-in configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
weichweich committed Nov 22, 2024
1 parent dbda091 commit 99902a9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion git-cliff-core/src/embed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ impl BuiltinConfig {
///
/// [`Config`]: Config
pub fn parse(name: String) -> Result<(Config, String)> {
Ok((toml::from_str(&Self::get_config(name.to_string())?)?, name))
let raw_config = Self::get_config(name.to_string())?;
let parsed = config::Config::builder()
.add_source(config::File::from_str(
&raw_config,
config::FileFormat::Toml,
))
.add_source(
config::Environment::with_prefix("GIT_CLIFF").separator("__"),
)
.build()?
.try_deserialize()?;
Ok((parsed, name))
}
}

0 comments on commit 99902a9

Please sign in to comment.