File tree Expand file tree Collapse file tree 5 files changed +13
-7
lines changed Expand file tree Collapse file tree 5 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -746,7 +746,7 @@ mod tests {
746
746
) ;
747
747
748
748
let content_dir = template. content_dir ( ) . as_ref ( ) . unwrap ( ) ;
749
- let cargo = tokio:: fs:: read_to_string ( content_dir. join ( "Cargo.toml" ) )
749
+ let cargo = tokio:: fs:: read_to_string ( content_dir. join ( "Cargo.toml.tmpl " ) )
750
750
. await
751
751
. unwrap ( ) ;
752
752
assert ! ( cargo. contains( "name = \" {{project-name | kebab_case}}\" " ) ) ;
Original file line number Diff line number Diff line change @@ -344,13 +344,18 @@ impl Run {
344
344
let template_parser = Self :: template_parser ( ) ;
345
345
let contents = paths
346
346
. iter ( )
347
- . map ( std:: fs:: read)
348
- . map ( |c| {
349
- c. map_err ( |e| e. into ( ) )
350
- . and_then ( |cc| TemplateContent :: infer_from_bytes ( cc, & template_parser) )
351
- } )
347
+ . map ( |path| TemplateContent :: infer_from_bytes ( std:: fs:: read ( path) ?, & template_parser) )
352
348
. collect :: < Result < Vec < _ > , _ > > ( ) ?;
353
- let pairs = paths. into_iter ( ) . zip ( contents) . collect ( ) ;
349
+ // Strip optional .tmpl extension
350
+ // Templates can use this if they don't want to store files with their final extensions
351
+ let paths = paths. into_iter ( ) . map ( |p| {
352
+ if p. extension ( ) . is_some_and ( |e| e == "tmpl" ) {
353
+ p. with_extension ( "" )
354
+ } else {
355
+ p
356
+ }
357
+ } ) ;
358
+ let pairs = paths. zip ( contents) . collect ( ) ;
354
359
Ok ( pairs)
355
360
}
356
361
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -485,6 +485,7 @@ Caused by:
485
485
486
486
#[ test]
487
487
#[ cfg( feature = "extern-dependencies-tests" ) ]
488
+ #[ ignore = "https://github.com/fermyon/spin/issues/2457" ]
488
489
// TODO: Check why python is not picking up the spin_sdk from site_packages
489
490
// Currently installing to the local directory to get around it.
490
491
fn http_python_template_smoke_test ( ) -> anyhow:: Result < ( ) > {
You can’t perform that action at this time.
0 commit comments