qetza / replacetokens-task

Azure Pipelines task to replace tokens in files with variables.
MIT License
11 stars 2 forks source link

Add support for if/else block #40

Closed vanmash closed 2 months ago

vanmash commented 3 months ago

Can replacetokens-task support if/else block?

it would be useful for helm's values.yaml file

reference: https://helm.sh/docs/chart_template_guide/control_structures/#ifelse

qetza commented 3 months ago

Hi @vanmash, Thanks for the suggestion but the goal of my task is to do a simple find and replace with as less process as possible.

Adding support for if/else would need to define a grammar, have a parser and runtime code execution which would complexify the code and increase the risk of execution error.

My recommendation if you want conditional support would be to do this through scripting by either dynamically updating the file structure or dynamically generating variable values.