Skip to content

Commit f3f81ab

Browse files
authored
chore: fix bug in xtask doc gen (#313)
1 parent f1bf452 commit f3f81ab

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

.github/workflows/mdbook.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ on:
77
- staging
88
paths:
99
- 'docs/**'
10+
- 'crates/xtask/**'
1011
- '.github/workflows/mdbook.yml'
1112
pull_request:
1213
branches:
1314
- "**"
1415
paths:
1516
- 'docs/**'
17+
- 'crates/xtask/**'
1618
- '.github/workflows/mdbook.yml'
1719

1820
jobs:

crates/xtask/src/main.rs

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,24 +1097,23 @@ impl Xtasks {
10971097

10981098
fn docs(mut app_settings: GlobalArgs, open: bool, no_rust_docs: bool) -> Result<()> {
10991099
// find [package.metadata."docs.rs"] key in Cargo.toml
1100-
if !no_rust_docs {
1101-
info!("installing mdbook ladfile preprocessor binary");
1102-
Self::install(app_settings.clone(), Binary::MdbookPreprocessor)?;
1100+
info!("installing mdbook ladfile preprocessor binary");
1101+
Self::install(app_settings.clone(), Binary::MdbookPreprocessor)?;
11031102

1104-
info!("Running docgen example to generate ladfiles");
1105-
Self::example(app_settings.clone(), "docgen".to_owned())?;
1103+
info!("Running docgen example to generate ladfiles");
1104+
Self::example(app_settings.clone(), "docgen".to_owned())?;
11061105

1107-
// copy the `<workspace>/assets/bindings.lad.json` file to it's path in the book
1108-
let ladfile_path =
1109-
Self::relative_workspace_dir(&app_settings, "assets/bindings.lad.json")?;
1110-
let destination_path =
1111-
Self::relative_workspace_dir(&app_settings, "docs/src/ladfiles/bindings.lad.json")?;
1106+
// copy the `<workspace>/assets/bindings.lad.json` file to it's path in the book
1107+
let ladfile_path = Self::relative_workspace_dir(&app_settings, "assets/bindings.lad.json")?;
1108+
let destination_path =
1109+
Self::relative_workspace_dir(&app_settings, "docs/src/ladfiles/bindings.lad.json")?;
11121110

1113-
info!("Copying generated ladfile from: {ladfile_path:?} to: {destination_path:?}");
1114-
std::fs::create_dir_all(destination_path.parent().unwrap())?;
1115-
std::fs::copy(ladfile_path, destination_path)
1116-
.with_context(|| "copying generated ladfile")?;
1111+
info!("Copying generated ladfile from: {ladfile_path:?} to: {destination_path:?}");
1112+
std::fs::create_dir_all(destination_path.parent().unwrap())?;
1113+
std::fs::copy(ladfile_path, destination_path)
1114+
.with_context(|| "copying generated ladfile")?;
11171115

1116+
if !no_rust_docs {
11181117
info!("Building rust docs");
11191118
let metadata = Self::main_workspace_cargo_metadata()?;
11201119

0 commit comments

Comments
 (0)