mirror of
https://github.com/figsoda/mmtc
synced 2025-02-16 21:38:38 +00:00
only generate completions if GEN_COMPLETIONS=1
This commit is contained in:
parent
7ca70aa895
commit
2c0289d64a
1 changed files with 6 additions and 0 deletions
6
build.rs
6
build.rs
|
@ -6,6 +6,12 @@ use std::{env, fs::create_dir_all, path::Path};
|
|||
include!("src/cli.rs");
|
||||
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-env-changed=GEN_COMPLETIONS");
|
||||
|
||||
if env::var_os("GEN_COMPLETIONS") != Some("1".into()) {
|
||||
return;
|
||||
}
|
||||
|
||||
let out = &Path::new(&env::var_os("OUT_DIR").unwrap()).join("completions");
|
||||
create_dir_all(out).unwrap();
|
||||
let app = &mut Opts::into_app();
|
||||
|
|
Loading…
Add table
Reference in a new issue