Skip to content

Commit 62a1a9b

Browse files
committed
Fix a case where a RustBook command is potentially not executed
We can move the command creation to a block where it is clear that the command will be executed.
1 parent 5fe5c75 commit 62a1a9b

File tree

1 file changed

+7
-2
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+7
-2
lines changed

src/bootstrap/src/core/build_steps/doc.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,20 @@ impl<P: Step> Step for RustbookSrc<P> {
146146
let out = out.join(&name);
147147
let index = out.join("index.html");
148148
let rustbook = builder.tool_exe(Tool::Rustbook);
149-
let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook);
150149

151150
if !builder.config.dry_run()
152151
&& (!up_to_date(&src, &index) || !up_to_date(&rustbook, &index))
153152
{
154153
builder.info(&format!("Rustbook ({target}) - {name}"));
155154
let _ = fs::remove_dir_all(&out);
156155

157-
rustbook_cmd.arg("build").arg(&src).arg("-d").arg(&out).run(builder);
156+
builder
157+
.tool_cmd(Tool::Rustbook)
158+
.arg("build")
159+
.arg(&src)
160+
.arg("-d")
161+
.arg(&out)
162+
.run(builder);
158163

159164
for lang in &self.languages {
160165
let out = out.join(lang);

0 commit comments

Comments
 (0)