summaryrefslogtreecommitdiffstats
path: root/build.rs
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2018-02-10 10:30:35 -0500
committerAndrew Gallant <jamslam@gmail.com>2018-02-10 12:12:47 -0500
commit09c5b2c4eab68a6a59a044ea149b8487b8ff5002 (patch)
tree14b97d16361b89bb1e42514b105e556eb94a891d /build.rs
parent904c75bd302311fe9e5e5a7238299e0105e19c8b (diff)
ci: update deployment for doc rearrangement
This fixes CI to handle the new documentation files. We also continue to do more cleanup. In particular, we devise a nicer way of detecting the most recent Cargo OUT_DIR by writing a dummy file, and looking for the most recently modified version of that file.
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/build.rs b/build.rs
index 9fc3ba5e..81fb4873 100644
--- a/build.rs
+++ b/build.rs
@@ -31,6 +31,11 @@ fn main() {
}
};
fs::create_dir_all(&outdir).unwrap();
+
+ let stamp_path = Path::new(&outdir).join("ripgrep-stamp");
+ if let Err(err) = File::create(&stamp_path) {
+ panic!("failed to write {}: {}", stamp_path.display(), err);
+ }
if let Err(err) = generate_man_page(&outdir) {
eprintln!("failed to generate man page: {}", err);
}
@@ -65,6 +70,10 @@ fn generate_man_page<P: AsRef<Path>>(outdir: P) -> io::Result<()> {
eprintln!("Error from running 'a2x': {}", err);
return Ok(());
}
+ // 1. Read asciidoc template.
+ // 2. Interpolate template with auto-generated docs.
+ // 3. Save interpolation to disk.
+ // 4. Use a2x (part of asciidoc) to convert to man page.
let outdir = outdir.as_ref();
let cwd = env::current_dir()?;
let tpl_path = cwd.join("doc").join("rg.1.txt.tpl");