Rollup merge of #133550 - onur-ozkan:doc-log, r=jieyouxu

print generated doc paths

Resolves #133002
This commit is contained in:
Guillaume Gomez 2024-11-28 03:14:52 +01:00 committed by GitHub
commit ed913fe3ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1523,15 +1523,19 @@ impl<'a> Builder<'a> {
pub(crate) fn maybe_open_in_browser<S: Step>(&self, path: impl AsRef<Path>) {
if self.was_invoked_explicitly::<S>(Kind::Doc) {
self.open_in_browser(path);
} else {
self.info(&format!("Doc path: {}", path.as_ref().display()));
}
}
pub(crate) fn open_in_browser(&self, path: impl AsRef<Path>) {
let path = path.as_ref();
if self.config.dry_run() || !self.config.cmd.open() {
self.info(&format!("Doc path: {}", path.display()));
return;
}
let path = path.as_ref();
self.info(&format!("Opening doc {}", path.display()));
if let Err(err) = opener::open(path) {
self.info(&format!("{err}\n"));