Skip to content

Commit

Permalink
Fix config.yaml output/extension empty value bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JamyGolden committed Oct 6, 2024
1 parent fa65e9a commit 6065405
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## Unreleased

### Fixed

- Fix bug where CLI gives an error if `output` or `extension`
`template/config.yaml` properties are empty

## Changed

- BREAKING: Remove `tinted_builder` exports since they should be
imported from `tinted_builder` crate itself
- Export `get_scheme_files` to allow Rust users to get a
`&'static [SchemeFile]` from a directory

## [0.12.0] - 2024-10-05

## Changed
Expand Down
28 changes: 22 additions & 6 deletions tinted-builder-rust/src/operations/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,35 @@ fn generate_themes_for_config(
(Some(filename), _, _) => Ok(filename.to_string()),
(None, Some(extension), Some(output)) => {
if !is_quiet {
if !extension.is_empty() {
println!("Warning: \"extension\" is a deprecated config property, use \"filename\" instead.");
}
if !output.is_empty() {
println!("Warning: \"output\" is a deprecated config property, use \"filename\" instead.");
}
println!("Warning: \"extension\" is a deprecated config property, use \"filename\" instead.");
println!("Warning: \"output\" is a deprecated config property, use \"filename\" instead.");
}

Ok(format!(
"{}/{{{{ scheme-system }}}}-{{{{ scheme-slug }}}}{}",
output, extension
))
}
(None, None, Some(output)) => {
if !is_quiet {
println!("Warning: \"output\" is a deprecated config property, use \"filename\" instead.");
}

Ok(format!(
"{}/{{{{ scheme-system }}}}-{{{{ scheme-slug }}}}",
output
))
}
(None, Some(extension), None) => {
if !is_quiet {
println!("Warning: \"extension\" is a deprecated config property, use \"filename\" instead.");
}

Ok(format!(
"{{{{ scheme-system }}}}-{{{{ scheme-slug }}}}{}",
extension
))
}
_ => Err(anyhow!(
"Config file is missing \"filepath\" or \"extension\" and \"output\" properties"
)),
Expand Down

0 comments on commit 6065405

Please sign in to comment.