geeklearningio/gl-vsts-tasks-file-patch

No option to patch with properties

hajtomoto opened this issue · 1 comments

Are you reporting a bug or a feature request ?

  • Bug
  • Feature request

Description

So I can patch my xml file with whatever I want and its working fine if I only want to replace/add value e.g.

JsonPatchContent: '+ /configuration/environmentVariable => "TEST"'

will create:
<environmentVariable>TEST</environmentVariable>

But what I would like to create is environmentVariable with properties as bellow:
<environmentVariable name="TEST" value="1234" />

Unless I missed smth or instructions are not clear enough, I cannot achieve that using current xml file patch.

Hi @hajtomoto,

The following should work for you:

+ /configuration/environmentVariable => { "@name" :  "TEST", "@value": "1234"  }

You can also have a look at the tests for more examples https://github.com/geeklearningio/gl-vsts-tasks-file-patch/blob/master/Tests/XmlPatch/xmlPatcher.spec.ts