From dc8e6097feedccbb816f13a2f6e39cd1dd007996 Mon Sep 17 00:00:00 2001 From: Friendseeker <66892505+Friendseeker@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:12:58 -0700 Subject: [PATCH] Handle UNC path --- build.sbt | 2 +- io/src/main/scala/sbt/io/IO.scala | 4 ++-- io/src/main/scala/sbt/io/Path.scala | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index ae2cf436..52752664 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,7 @@ ThisBuild / version := { (sys.env.get("BUILD_VERSION") orElse sys.props.get("sbt.build.version")) match { case Some(v) => v case _ => - if ((ThisBuild / isSnapshot).value) "1.6.0-SNAPSHOT" + if ((ThisBuild / isSnapshot).value) "1.10.2-SNAPSHOT" else old } } diff --git a/io/src/main/scala/sbt/io/IO.scala b/io/src/main/scala/sbt/io/IO.scala index 42585017..67d23f4b 100644 --- a/io/src/main/scala/sbt/io/IO.scala +++ b/io/src/main/scala/sbt/io/IO.scala @@ -1160,7 +1160,7 @@ object IO { */ def directoryURI(dir: File): URI = { assertAbsolute(dir) - directoryURI(dir.toURI.normalize) + directoryURI(dir.toPath.normalize.toUri) } /** @@ -1177,7 +1177,7 @@ object IO { else new URI(str + "/") - dirURI.normalize + new File(dirURI).toPath.normalize.toUri } private[sbt] val isWindows: Boolean = diff --git a/io/src/main/scala/sbt/io/Path.scala b/io/src/main/scala/sbt/io/Path.scala index beae6543..ee729f0f 100644 --- a/io/src/main/scala/sbt/io/Path.scala +++ b/io/src/main/scala/sbt/io/Path.scala @@ -292,7 +292,7 @@ object Path extends Mapper { def fileProperty(name: String): File = new File(System.getProperty(name)) def userHome: File = fileProperty("user.home") - def absolute(file: File): File = new File(file.toURI.normalize).getAbsoluteFile + def absolute(file: File): File = new File(file.toPath.normalize.toUri).getAbsoluteFile def makeString(paths: Seq[File]): String = makeString(paths, File.pathSeparator) def makeString(paths: Seq[File], sep: String): String = { val separated = paths.map(_.getAbsolutePath)