Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow template to have tmpl extension #2456

Merged
merged 3 commits into from
Apr 16, 2024
Merged

Allow template to have tmpl extension #2456

merged 3 commits into from
Apr 16, 2024

Conversation

rylev
Copy link
Collaborator

@rylev rylev commented Apr 15, 2024

Fixes #2455

The template handler will automatically strip the .tmpl extension.

Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
@rylev rylev requested review from lann and itowlson April 15, 2024 15:23
Copy link
Collaborator

@lann lann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

// Strip optional .tmpl extension
// Templates can use this if they don't want to store files with their final extensions
let paths = paths.into_iter().map(|p| {
if p.extension().map(|e| e == "tmpl").unwrap_or_default() {
Copy link
Collaborator

@lann lann Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an option now (Rust 1.70):

Suggested change
if p.extension().map(|e| e == "tmpl").unwrap_or_default() {
if p.extension().is_some_and(|e| e == "tmpl") {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where are we documenting Spin's MSRV? CI is testing 1.74 but the contributing docs say 1.68. I assume the contributing docs are just out of date?

Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
@rylev rylev merged commit 04a58b9 into main Apr 16, 2024
17 checks passed
@rylev rylev deleted the tmpl-extension branch April 16, 2024 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid character { in package name
2 participants