aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stage1/cbt.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/stage1/cbt.scala b/stage1/cbt.scala
index 44506d2..ea3237d 100644
--- a/stage1/cbt.scala
+++ b/stage1/cbt.scala
@@ -18,6 +18,16 @@ object `package`{
val sonatypeSnapshots = sonatypeBase ++ "snapshots"
private val lib = new BaseLib
+
+ implicit class PathExtensionMethods( path: Path ){
+ def /(s: String): Path = path.resolve(s)
+ def ++( s: String ): Path = {
+ if(s endsWith "/") throw new Exception(
+ """Trying to append a String that ends in "/" to a Path would loose the trailing "/". Use .stripSuffix("/") if you need to."""
+ )
+ Paths.get( path.toString ++ s )
+ }
+ }
implicit class FileExtensionMethods( file: File ){
def ++( s: String ): File = {
if(s endsWith "/") throw new Exception(