make gradle zip directory drop helper function nicer

This commit is contained in:
Adam 2022-05-21 12:44:51 +02:00
parent 9f48270a0a
commit 227ac27652
2 changed files with 8 additions and 3 deletions

View file

@ -74,5 +74,10 @@ fun Directory.filesChecksum() = asFileTree
/** Drop the first [count] directories from the path */
fun FileCopyDetails.dropDirectories(count: Int = 1): RelativePath =
fun FileCopyDetails.dropDirectories(count: Int): RelativePath =
RelativePath(true, *relativePath.segments.drop(count).toTypedArray())
/** Drop the first directory from the path */
fun FileCopyDetails.dropDirectory(): RelativePath =
dropDirectories(1)