File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 11package scripts
22
33import java .io .PrintStream
4- import java .nio .file .Path
4+ import java .nio .file .{ Path , FileAlreadyExistsException }
55
66import io .bazel .rulesscala .io_utils .DeleteRecursively
77import io .bazel .rulesscala .jar .JarCreator
@@ -12,6 +12,7 @@ import scalapb.ScalaPbCodeGenerator
1212import java .nio .file .{Files , Paths }
1313import scalapb .{ScalaPBC , ScalaPbCodeGenerator , ScalaPbcException }
1414import java .net .URLClassLoader
15+ import scala .util .{Try , Failure }
1516
1617object ScalaPBWorker extends GenericWorker (new ScalaPBGenerator ) {
1718
@@ -39,7 +40,12 @@ class ScalaPBGenerator extends Processor {
3940 val relativePath = root.relativize(fullPath)
4041
4142 relativePath.toFile.getParentFile.mkdirs
42- Files .copy(fullPath, relativePath)
43+ Try (Files .copy(fullPath, relativePath)) match {
44+ case Failure (err : FileAlreadyExistsException ) =>
45+ Console .println(s " File already exists, skipping: ${err.getMessage}" )
46+ case Failure (err) => throw err
47+ case _ => ()
48+ }
4349 }
4450 }
4551 def deleteDir (path : Path ): Unit =
You can’t perform that action at this time.
0 commit comments