Skip to content

Commit 5e4618f

Browse files
committed
address review comment
1 parent 6bc36d1 commit 5e4618f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/bootstrap/doc.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::fs;
1212
use std::io;
1313
use std::path::{Path, PathBuf};
1414

15-
use crate::builder::{Builder, Compiler, RunConfig, ShouldRun, Step};
15+
use crate::builder::{Builder, Compiler, Kind, RunConfig, ShouldRun, Step};
1616
use crate::cache::{Interned, INTERNER};
1717
use crate::compile;
1818
use crate::config::{Config, TargetSelection};
@@ -370,7 +370,10 @@ impl Step for Standalone {
370370

371371
// We open doc/index.html as the default if invoked as `x.py doc --open`
372372
// with no particular explicit doc requested (e.g. library/core).
373-
builder.maybe_open_in_browser::<Self>(out.join("index.html"));
373+
if builder.paths.is_empty() || builder.was_invoked_explicitly::<Self>(Kind::Doc) {
374+
let index = out.join("index.html");
375+
builder.open_in_browser(&index);
376+
}
374377
}
375378
}
376379

0 commit comments

Comments
 (0)