From 8087f0b636b94ff5763a3a5637dea9a343784bd7 Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Thu, 10 Mar 2022 05:15:48 -0500 Subject: 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 --- build.rs | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 build.rs (limited to 'build.rs') 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(); -} -- cgit v1.2.3