Skip to content

Add the delayed variable substitution #82

@LaurentDardenne

Description

@LaurentDardenne

My goal is to create a plaster manifest template.
I try to prevent the substitution of a pattern variable in a template file :

$VcsPathRepository="<!%=${PLASTER_DestinationPath}%>"
[Environment]::SetEnvironmentVariable("<%=${PLASTER_PARAM_ProjectName}%>Profile",$VcsPathRepository, "User") }

the result :

$VcsPathRepository="<%=${PLASTER_DestinationPath}%>"
[Environment]::SetEnvironmentVariable("PlasterTestProfile",$VcsPathRepository, "User") }

I combine a templatefile element and a modify element :

        <templateFile source='Templates\Project_Clone.T.Ps1'
            destination='Project_Clone.ps1'
            encoding='UTF8'/> 

        <modify path='Project_Clone.ps1'>
            <replace >
                <original><![CDATA[(?s)(<!%=)(.*?)(%>)]]></original>
                <substitute><![CDATA[<%=$2$3]]></substitute>
            </replace>
        </modify> 

This works.
But, if I want to edit multiple files I must duplicate the element Modify
Is it possible to add multiple processing for the Modify element and/or add the delayed variable substitution ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions