Skip to content

Commit d04fe49

Browse files
committed
use readme as about.md if its missing
1 parent 3f4c42f commit d04fe49

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/package.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,14 +290,26 @@ fn create_package(
290290
);
291291

292292
// Custom hardcoded resources
293-
for file in &["logo.png", "about.md", "changelog.md", "support.md"] {
293+
for file in ["logo.png", "about.md", "changelog.md", "support.md"] {
294294
let path = root_path.join(file);
295295
if path.exists() {
296296
std::fs::copy(path, working_dir.join(file))
297297
.nice_unwrap(format!("Could not copy {file}"));
298298
}
299299
}
300300

301+
// Use readme as about.md if its missing
302+
if !root_path.join("about.md").exists() {
303+
for file in ["README.md", "readme.md", "Readme.md"] {
304+
let path = root_path.join(file);
305+
if path.exists() {
306+
std::fs::copy(path, working_dir.join("about.md"))
307+
.nice_unwrap(format!("Could not copy {file}"));
308+
break;
309+
}
310+
}
311+
}
312+
301313
// Copy headers
302314
if let Some(ref api) = mod_file_info.api {
303315
for header in &api.include {

0 commit comments

Comments
 (0)