Skip to content

Commit e8bbb85

Browse files
committed
feat(common-utils): Add convenience operators to resolve File paths
Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent ba4a6a8 commit e8bbb85

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

utils/common/src/main/kotlin/FileUtils.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,13 @@ fun String.expandTilde(): String =
182182
} else {
183183
this
184184
}
185+
186+
/**
187+
* A convenience operator to resolve [relativePath] against this file.
188+
*/
189+
operator fun File.div(relativePath: File): File = resolve(relativePath)
190+
191+
/**
192+
* A convenience operator to resolve [relativePath] against this file.
193+
*/
194+
operator fun File.div(relativePath: String): File = resolve(relativePath)

0 commit comments

Comments
 (0)