summaryrefslogtreecommitdiffstats
path: root/build.rs
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2022-03-10 05:15:48 -0500
committerGitHub <noreply@github.com>2022-03-10 05:15:48 -0500
commit8087f0b636b94ff5763a3a5637dea9a343784bd7 (patch)
tree3429a410bde0feef39424e87bbe99c0ba7b4f20c /build.rs
parent92ec3599363c710815c286e975bbb6cc748708dd (diff)
ci: add manpage generation, migrate build script (#692)
Adds manpage generation to the build process, as well as following the xtask concept of adding additional build scripts that only need to run on deploy/nightly as opposed to `build.rs`. Note this doesn't follow the recommended method of using workplaces because I don't really want to shift the entire repo structure just for this. More on xtask: https://github.com/matklad/cargo-xtask
Diffstat (limited to 'build.rs')
-rw-r--r--build.rs33
1 files changed, 0 insertions, 33 deletions
diff --git a/build.rs b/build.rs
deleted file mode 100644
index 479ab963..00000000
--- a/build.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-use clap_complete::{generate_to, shells::Shell};
-use std::{env, fs, process};
-
-include!("src/clap.rs");
-
-fn main() {
- // OUT_DIR is where extra build files are written to for Cargo.
- let out_dir = match env::var_os("OUT_DIR") {
- Some(out_dir) => out_dir,
- None => {
- eprintln!("The OUT_DIR environment variable was not set! Aborting...");
- process::exit(1)
- }
- };
- match fs::create_dir_all(&out_dir) {
- Ok(()) => {}
- Err(err) => {
- eprintln!(
- "Failed to create a directory at OUT_DIR location {:?}, encountered error {:?}. Aborting...",
- out_dir, err
- );
- process::exit(1)
- }
- }
-
- // Generate completions
- let mut app = build_app();
- generate_to(Shell::Bash, &mut app, "btm", &out_dir).unwrap();
- generate_to(Shell::Zsh, &mut app, "btm", &out_dir).unwrap();
- generate_to(Shell::Fish, &mut app, "btm", &out_dir).unwrap();
- generate_to(Shell::PowerShell, &mut app, "btm", &out_dir).unwrap();
- generate_to(Shell::Elvish, &mut app, "btm", &out_dir).unwrap();
-}