Skip to content

Commit

Permalink
Fix bug where package name instead of description is written into des…
Browse files Browse the repository at this point in the history
…cription property
  • Loading branch information
Benjamin Richner committed Feb 12, 2023
1 parent 08e3d56 commit 0cd17d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "winresource"
description = "Create and set windows icons and metadata for executables"
version = "0.1.13"
version = "0.1.14"
authors = ["Max Resch <resch.max@gmail.com>"]
license = "MIT"
repository = "https://github.com/BenjaminRi/winresource"
Expand Down
17 changes: 13 additions & 4 deletions lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,19 @@ impl WindowsResource {
"ProductName".to_string(),
env::var("CARGO_PKG_NAME").unwrap(),
);
props.insert(
"FileDescription".to_string(),
env::var("CARGO_PKG_NAME").unwrap(),
);

// If there is no description, fallback to name
let description = if let Ok(description) = env::var("CARGO_PKG_DESCRIPTION") {
if !description.is_empty() {
description
} else {
env::var("CARGO_PKG_NAME").unwrap()
}
} else {
env::var("CARGO_PKG_NAME").unwrap()
};

props.insert("FileDescription".to_string(), description);

parse_cargo_toml(&mut props).unwrap();

Expand Down

0 comments on commit 0cd17d6

Please sign in to comment.