Rollup merge of #84393 - GuillaumeGomez:better-open-handling, r=jyn514
Support `x.py doc std --open` I usually run this command: ``` ./x.py doc std --stage 1 --jobs 8 ``` Then I gave a try to `--open` and realized it wasn't working. I finally realized it was simply because it was only handling paths starting with `library`. This PR allows to handle both kinds of paths. cc ``@jyn514`` r? ``@Mark-Simulacrum``
This commit is contained in:
commit
0749ea7cb8
1 changed files with 10 additions and 6 deletions
|
@ -470,12 +470,16 @@ impl Step for Std {
|
||||||
// Look for library/std, library/core etc in the `x.py doc` arguments and
|
// Look for library/std, library/core etc in the `x.py doc` arguments and
|
||||||
// open the corresponding rendered docs.
|
// open the corresponding rendered docs.
|
||||||
for path in builder.paths.iter().map(components_simplified) {
|
for path in builder.paths.iter().map(components_simplified) {
|
||||||
if path.get(0) == Some(&"library") {
|
let requested_crate = if path.get(0) == Some(&"library") {
|
||||||
let requested_crate = &path[1];
|
&path[1]
|
||||||
if krates.contains(&requested_crate) {
|
} else if !path.is_empty() {
|
||||||
let index = out.join(requested_crate).join("index.html");
|
&path[0]
|
||||||
open(builder, &index);
|
} else {
|
||||||
}
|
continue;
|
||||||
|
};
|
||||||
|
if krates.contains(&requested_crate) {
|
||||||
|
let index = out.join(requested_crate).join("index.html");
|
||||||
|
open(builder, &index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue