Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

do not build shell code on docs.rs #224

Merged
merged 1 commit into from
Dec 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// You should have received a copy of the MIT License along with this software.
// If not, see <https://opensource.org/licenses/MIT>.

use std::env;
use std::fs;

use clap::IntoApp;
Expand All @@ -29,16 +30,17 @@ pub mod bucketd {
}

fn main() -> Result<(), configure_me_codegen::Error> {
let outdir = "./shell";

fs::create_dir_all(outdir).expect("failed to create shell dir");
for app in [rgbd::Opts::command(), bucketd::Opts::command()].iter_mut() {
let name = app.get_name().to_string();
generate_to(Bash, app, &name, &outdir)?;
generate_to(PowerShell, app, &name, &outdir)?;
generate_to(Zsh, app, &name, &outdir)?;
if env::var("DOCS_RS").is_err() {
let outdir = "./shell";
fs::create_dir_all(outdir).expect("failed to create shell dir");
for app in [rgbd::Opts::command(), bucketd::Opts::command()].iter_mut() {
let name = app.get_name().to_string();
generate_to(Bash, app, &name, &outdir)?;
generate_to(PowerShell, app, &name, &outdir)?;
generate_to(Zsh, app, &name, &outdir)?;
}
// configure_me_codegen::build_script_auto()
}

// configure_me_codegen::build_script_auto()
Ok(())
}