@@ -4,6 +4,7 @@ use std::{
4
4
collections:: BTreeMap ,
5
5
fmt:: Write ,
6
6
io:: { BufRead , BufReader } ,
7
+ path:: Path ,
7
8
} ;
8
9
9
10
use mdbook:: {
@@ -136,9 +137,9 @@ impl Blacksmith {
136
137
( "toolstate.html" , "/infra/toolstate.html" ) ,
137
138
( "triage-procedure.html" , "/release/triage-procedure.html" ) ,
138
139
( "x-py.html" , "https://rust-lang.github.io/rustc-guide/building/how-to-build-and-run.html" ) ,
139
- ( "bug-fix-procedure.html" , "https://rust-lang.github.io/rustc-guide/bug-fix-procedure.html" ) ,
140
- ( "diagnostic-codes.html" , "https://rust-lang.github.io/rustc-guide/diagnostics/diagnostic-codes.html" ) ,
141
- ( "profile-queries.html" , "https://rust-lang.github.io/rustc-guide/queries/profiling.html" ) ,
140
+ ( "compiler/ bug-fix-procedure.html" , "https://rust-lang.github.io/rustc-guide/bug-fix-procedure.html" ) ,
141
+ ( "compiler/ diagnostic-codes.html" , "https://rust-lang.github.io/rustc-guide/diagnostics/diagnostic-codes.html" ) ,
142
+ ( "compiler/ profile-queries.html" , "https://rust-lang.github.io/rustc-guide/queries/profiling.html" ) ,
142
143
] ;
143
144
144
145
// Inititalise book directory if not built yet.
@@ -151,6 +152,10 @@ impl Blacksmith {
151
152
152
153
log:: trace!( "Redirecting {} to {}." , filename, url) ;
153
154
155
+ if let Some ( parent) = Path :: new ( filename) . parent ( ) {
156
+ std:: fs:: create_dir_all ( parent) . unwrap ( ) ;
157
+ }
158
+
154
159
std:: fs:: write ( dir. join ( filename) , template) . unwrap ( ) ;
155
160
}
156
161
}
0 commit comments