-
Notifications
You must be signed in to change notification settings - Fork 56
Wrong indentation when variable is multiline #326
Comments
Hi @trashhead, So the YAML value for application.properties: |
customMessage=This is dev machine
customMessage2=This is dev machine2 will be customMessage=This is dev machine
customMessage2=This is dev machine2
(note the end of line at the end also) If you need some spaces at the start of your lines you need to add it after the YAML indentation (your first line has the correct indentation because the indentation is in the file before the replace token) application.properties: |-
customMessage=This is dev machine
customMessage2=This is dev machine2 (the added |
I see you have some functions implemented, upper, lower etc. Would it not be possible to add something similiar to "indent" which might take an argument of how much it should indent every row. |
Hi @trashhead, So
and apiVersion: v1
kind: ConfigMap
metadata:
name: app-test-config
namespace: elinstallation
data:
application.properties: |
#{indent(application.properties, 4)}# would become: apiVersion: v1
kind: ConfigMap
metadata:
name: app-test-config
namespace: elinstallation
data:
application.properties: |
customMessage=This is dev machine
customMessage2=This is dev machine2
note: the last empty line will also be indented |
Since anything could be stored in a variable, even yaml, keeping all indentations specified within the variable is important So these lines:
and this:
would result in:
and these:
it would result in:
So maybe an argument isn't actually necessary? |
On further consideration maybe there doesnt even have to be an indent function? |
Hi @trashhead, |
If it is possible to implement that indent-function that would be nice :) |
I'm archiving the project and moving it to a new repository https://github.com/qetza/replacetokens-task |
I have this variable defined in my azure pipeline.
I use it here:
But this results in the following:
First line is ok but second has wrong indentation.
The text was updated successfully, but these errors were encountered: