Include pattern for all files and subdirectories


(Samuel Svelta) #1

Hi,

I have the following problem. I want to include only files and subdirectories from Directory1 into Directory2.

Directory1
-- Subdirecory1
-- Subdirectory2

Directory2
-- Subdirecory1
-- Subdirectory2

from(file) {
include '/directory/Directory1/**'
into 'directory/Directory2'
}

This piece of code includes also Directory1 under Directory2:

Directory2
-- Directory1
    -- Subdirectory1
    -- Subdirectory2
-- Subdirecory1
-- Subdirectory2

How to solve this?


(Chris Doré) #2

Try something like:

from(new File(file, 'directory/Directory1')) {
    into 'directory/Directory2'
}