Reputation: 581
I'm trying to copy the content of a directory into another directory on a Jenkins file. My first attempt was using xcopy, but I'm getting an error ( Invalid number of parameters).
bat 'xcopy cashplus-backoffice/cashplus-backoffice-ui/build/web cashplus-backoffice/src/main/resources/static /e /h'
My second attempt was to using File Operation plugin as follows:
fileOperations([fileCopyOperation(
excludes: '',
flattenFiles: false,
includes: 'cashplus-backoffice/cashplus-backoffice-ui/build/web/**',
targetLocation: 'cashplus-backoffice/src/main/resources/static'
)])
The problem with this solution is that it copy the whole tree and the content of the source folder ( cashplus-backoffice/cashplus-backoffice-ui/build/web. I want just the content of the web folder ). How can I achieve this?
Upvotes: 0
Views: 698
Reputation: 3076
You can use xcopy
command and use \\
instead of \
for windows.
Example:
bat "xcopy /E /H C:\\Data\\myfiles C:\\Data\\Documents\\"
Upvotes: 1