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

Add leading spaces to routes.swift #126

Merged
merged 1 commit into from
Mar 24, 2024

Conversation

tockrock
Copy link
Contributor

Currently when creating a new project without leaf, leading spaces are missing in ./Sources/App/routes.swift

func routes(_ app: Application) throws {
app.get { req async in

This PR adds the missing leading spaces to match expectation

func routes(_ app: Application) throws {
    app.get { req async in

Alternative considered modification was to move the mustache selection earlier, but caused Error: Mustache error: bad unescape tag, and was not able to find solution to resolve the issue.

func routes(_ app: Application) throws {{{#leaf}}
    app.get { req async throws in
        try await req.view.render("index", ["title": "Hello Vapor!"])
    }{{/leaf}}{{^leaf}}
    app.get { req async in

@tockrock tockrock requested review from 0xTim and gwynne as code owners March 24, 2024 06:12
Copy link
Member

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

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

Thanks!

@0xTim
Copy link
Member

0xTim commented Mar 24, 2024

For context, this looks like it was caused by the recent Mustache updates.

Why we haven't transitioned over to Leaf I don't know!

@gwynne
Copy link
Member

gwynne commented Mar 24, 2024

'Cause I was lazy when I did the update 😅. Thanks for this!

@0xTim 0xTim merged commit 2ff4040 into vapor:main Mar 24, 2024
11 checks passed
@tockrock
Copy link
Contributor Author

Thanks!

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.

3 participants