Skip to content

How to escape the expressions ${myVar} in a engine template ? #5

@rbecheras

Description

@rbecheras

I use Generate to create my own generators and engine as template engine.

When in a template I have a line including a template string (${myVar}), engine seems trying to find the myVar value to inject it in the template.

But here I'm generating a file containing some template strings like in es6 template strings of bash template string.

See below:

As you can see, here the template for the generating file .gitlab-ci.yml include the following line:

name: ${CI_COMMIT_REF_NAME}${CI_JOB_NAME}

But I need this line to be unchanged after the template have been rendered.

  1. How to escape the expressions ${myVar} in a engine template ?
  2. Is the expressions ${myVar} and <%= myVar %> equivalent ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions