Skip to content

Commit 002c64b

Browse files
committed
Fix compiling under Windows
`createSymbolicLink` documents that it may fail with UnsupportedOperationException on OS where symbolic links cannot be used, but it turns out that in practice it fails with FileSystemException on Windows when you don't have enough privileges to create symbolic links.
1 parent e4ca6a5 commit 002c64b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

project/Build.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import sbt._
33
import complete.DefaultParsers._
44
import java.io.{File, RandomAccessFile}
55
import java.nio.channels.FileLock
6-
import java.nio.file.Files
6+
import java.nio.file.{ Files, FileSystemException }
77
import java.util.Calendar
88

99
import scala.reflect.io.Path
@@ -407,7 +407,7 @@ object Build {
407407
Files.createSymbolicLink(/*link = */ dst.toPath, /*existing = */src.toPath)
408408
}
409409
} catch {
410-
case e: UnsupportedOperationException =>
410+
case _: UnsupportedOperationException | _: FileSystemException =>
411411
// If the OS doesn't support symbolic links, copy the directory instead.
412412
sbt.IO.copy(pairs, overwrite = true, preserveLastModified = true)
413413
}

0 commit comments

Comments
 (0)