How do I copy a single file using the CopyFiles Task without copying its entire enclosing folder hierarchy? When the following task executes:
- task: CopyFiles@2
inputs:
Contents: '**/dataSettings.json'
TargetFolder: '$(Build.ArtifactStagingDirectory)/$(buildConfiguration)/Nop.Web/App_Data'
It copies the entire folder hierarchy and the file 'src/Presentation/Nop.Web/App_Data/' to the target folder:
Nop.Web/App_Data/src/Presentation/Nop.Web/App_Data/dataSettings.json
I want it to copy the file to the following location:
Nop.Web/App_Data/dataSettings.json
If I change the Contents to dataSettings.json the file cannot be copied.
I am open to using another task to achieve the same result.