Reputation: 8428
I'm using a Copy Files task in a VSTS build to copy the results of a VS project (bin\Release
folder) to a subfolder in the staging directory.
What I expect is that the contents of the bin
folder should be in the staging\bin
folder:
drop\bin\
but instead it copies the full path to the the destination. So my binaries are all in
drop\bin\src\MySolution\MyProject\bin\Release\
Is there a way to copy just the files in my release folder to the staging folder without copying the full path?
Upvotes: 11
Views: 9935
Reputation: 249
Advanced => check Flatten Folders
or flattenFolders: true
in the YAML file.
I'm guessing this option didn't exist back then.
Upvotes: 5
Reputation: 2003
Worthwhile to mention it helps if you use BuildConfiguration variable so it doesn't break when you use a different build config:
Upvotes: 2
Reputation: 8428
So it turns out I just needed to change my source directory to the folder where the binaries were.
NOTE This only works because I know exactly where the desired files are. If you find this and you're trying to copy from multiple directories, you have a couple options:
- Multiple Copy Files tasks
- Just deal with the extra directories.
Upvotes: 17