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 22, 2024
1 parent 35e5da4 commit 92a69f5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ include!("src/cli.rs");
fn main() -> Result<(), clap::Error> {
use clap::CommandFactory;
use clap_complete::{generate_to, Shell};
use std::{env, fs, path};
use std::{fs, path, process::exit};

let out_dir = env!("OUT_DIR");
let out_dir = option_env!("OUT_DIR").unwrap_or_else(|| {
exit(0);
});
let dir = path::Path::new(&out_dir).join("completions/");
if !dir.exists() {
fs::create_dir(dir.clone()).expect("Failed to create 'completions' directory.");
Expand Down

0 comments on commit 92a69f5

Please sign in to comment.