Skip to content

Commit

Permalink
update build.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
mazznoer committed Aug 21, 2024
1 parent d2aa640 commit a912c4f
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
#[cfg(feature = "cli")]
use clap::CommandFactory;
#[cfg(feature = "cli")]
use clap_complete::{generate_to, Shell};
#[cfg(feature = "cli")]
use std::env;

#[cfg(feature = "cli")]
include!("src/cli.rs");

#[cfg(feature = "cli")]
fn main() -> Result<(), clap::Error> {
let outdir = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("completions/");
use clap::CommandFactory;
use clap_complete::{generate_to, Shell};
use std::{env, fs, path};

let outdir = path::Path::new(env!("CARGO_MANIFEST_DIR")).join("completions/");
if !outdir.exists() {
std::fs::create_dir(outdir.clone()).expect("Failed to create 'completions' directory.");
fs::create_dir(outdir.clone()).expect("Failed to create 'completions' directory.");
}

let mut cmd = Opt::command();
Expand Down

0 comments on commit a912c4f

Please sign in to comment.