mapCopyDest

fun Path.mapCopyDest(globPattern: String, dotglob: Boolean = false): Path?

Maps this path to its copy destination based on the globPattern used to collect this path.

In order words, assuming a shell expression cp [SOURCE]... [DIRECTORY], infer the path relative to the target directory using the argument provided to source.

Return

A relative path indicating where this path should be copied to relative to the target directory. null if this path is not matched by globPattern.