@@ -84,14 +84,6 @@ impl Run {
84
84
self . build_renderer_raw ( interaction) . await . into ( )
85
85
}
86
86
87
- fn allow_overwrite ( & self ) -> bool {
88
- // If the template variant asks to be generated into the app root,
89
- // we assume that it knows what it's doing and intends to avoid
90
- // overwriting. This is true for the one use case we have, although
91
- // we need to track if it's a flawed assumption in general cases.
92
- self . options . allow_overwrite || self . template . use_root ( & self . options . variant )
93
- }
94
-
95
87
// The 'raw' in this refers to the output type, which is an ugly representation
96
88
// of cancellation: Ok(Some(...)) means a result, Ok(None) means cancelled, Err
97
89
// means error. Why have this ugly representation? Because it makes it terser to
@@ -165,6 +157,14 @@ impl Run {
165
157
}
166
158
}
167
159
160
+ fn allow_overwrite ( & self ) -> bool {
161
+ // If the template variant asks to be generated into the app root,
162
+ // we assume that it knows what it's doing and intends to avoid
163
+ // overwriting. This is true for the one use case we have, although
164
+ // we need to track if it's a flawed assumption in general cases.
165
+ self . options . allow_overwrite || self . template . use_root ( & self . options . variant )
166
+ }
167
+
168
168
fn included_files (
169
169
& self ,
170
170
from : & Path ,
@@ -203,6 +203,11 @@ impl Run {
203
203
return crate :: renderer:: TemplateablePath :: Plain ( path) ;
204
204
}
205
205
206
+ // Windows file paths can't contain the pipe character used in templates.
207
+ // This masterful workaround will definitely not confuse anybody or cause
208
+ // any weird hiccups in six months time.
209
+ let path_str = path_str. replace ( "!!" , "|" ) ;
210
+
206
211
match parser. parse ( & path_str) {
207
212
Ok ( t) => crate :: renderer:: TemplateablePath :: Template ( t) ,
208
213
Err ( _) => crate :: renderer:: TemplateablePath :: Plain ( path) ,
0 commit comments