Skip to content

Commit

Permalink
Add build script to copy README for rsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
commonsensesoftware committed Dec 20, 2023
1 parent 2a37295 commit d10577a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use std::env::var;
use std::error::Error;
use std::fs::copy;
use std::path::PathBuf;

fn main() -> Result<(), Box<dyn Error>> {
let cwd = PathBuf::from(var("CARGO_MANIFEST_DIR").unwrap());
let root = cwd.parent().unwrap();
let readme = root.join("README.md");

if readme.exists() {
copy(root.join("README.md"), cwd.join("README.md"))?;
}

Ok(())
}
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![doc = include_str!("../README.md")]
#![doc = include_str!("README.md")]

mod inject;
mod inject_keyed;
Expand Down

0 comments on commit d10577a

Please sign in to comment.