diff --git a/.github/workflows/mdbook.yml b/.github/workflows/mdbook.yml index 19fbfef101..58ab545b79 100644 --- a/.github/workflows/mdbook.yml +++ b/.github/workflows/mdbook.yml @@ -7,12 +7,14 @@ on: - staging paths: - 'docs/**' + - 'crates/xtask/**' - '.github/workflows/mdbook.yml' pull_request: branches: - "**" paths: - 'docs/**' + - 'crates/xtask/**' - '.github/workflows/mdbook.yml' jobs: diff --git a/crates/xtask/src/main.rs b/crates/xtask/src/main.rs index c4752ad1d7..0ae4361d77 100644 --- a/crates/xtask/src/main.rs +++ b/crates/xtask/src/main.rs @@ -1097,24 +1097,23 @@ impl Xtasks { fn docs(mut app_settings: GlobalArgs, open: bool, no_rust_docs: bool) -> Result<()> { // find [package.metadata."docs.rs"] key in Cargo.toml - if !no_rust_docs { - info!("installing mdbook ladfile preprocessor binary"); - Self::install(app_settings.clone(), Binary::MdbookPreprocessor)?; + info!("installing mdbook ladfile preprocessor binary"); + Self::install(app_settings.clone(), Binary::MdbookPreprocessor)?; - info!("Running docgen example to generate ladfiles"); - Self::example(app_settings.clone(), "docgen".to_owned())?; + info!("Running docgen example to generate ladfiles"); + Self::example(app_settings.clone(), "docgen".to_owned())?; - // copy the `/assets/bindings.lad.json` file to it's path in the book - let ladfile_path = - Self::relative_workspace_dir(&app_settings, "assets/bindings.lad.json")?; - let destination_path = - Self::relative_workspace_dir(&app_settings, "docs/src/ladfiles/bindings.lad.json")?; + // copy the `/assets/bindings.lad.json` file to it's path in the book + let ladfile_path = Self::relative_workspace_dir(&app_settings, "assets/bindings.lad.json")?; + let destination_path = + Self::relative_workspace_dir(&app_settings, "docs/src/ladfiles/bindings.lad.json")?; - info!("Copying generated ladfile from: {ladfile_path:?} to: {destination_path:?}"); - std::fs::create_dir_all(destination_path.parent().unwrap())?; - std::fs::copy(ladfile_path, destination_path) - .with_context(|| "copying generated ladfile")?; + info!("Copying generated ladfile from: {ladfile_path:?} to: {destination_path:?}"); + std::fs::create_dir_all(destination_path.parent().unwrap())?; + std::fs::copy(ladfile_path, destination_path) + .with_context(|| "copying generated ladfile")?; + if !no_rust_docs { info!("Building rust docs"); let metadata = Self::main_workspace_cargo_metadata()?;