File tree Expand file tree Collapse file tree 2 files changed +21
-5
lines changed
build/src/main/scala/scala/build
core/src/main/scala/scala/build/errors Expand file tree Collapse file tree 2 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -702,11 +702,17 @@ object Build {
702702 case d : Directory =>
703703 // Filtering event for directories, to ignore those related to the .bloop directory in particular
704704 event =>
705- val p = os.Path (event.getTypedPath.getPath.toAbsolutePath)
706- val relPath = p.relativeTo(d.path)
707- val isHidden = relPath.segments.exists(_.startsWith(" ." ))
708- def isScalaFile = relPath.last.endsWith(" .sc" ) || relPath.last.endsWith(" .scala" )
709- def isJavaFile = relPath.last.endsWith(" .java" )
705+ val p = os.Path (event.getTypedPath.getPath.toAbsolutePath)
706+ val relPath = p.relativeTo(d.path)
707+ val isHidden = relPath.segments.exists(_.startsWith(" ." ))
708+ val pathLast = Try (relPath.last).toEither.orElse(Try (p.last).toEither) match {
709+ case Right (last) => last
710+ case Left (e) =>
711+ logger.log(WatchError (event, e))
712+ " "
713+ }
714+ def isScalaFile = pathLast.endsWith(" .sc" ) || pathLast.endsWith(" .scala" )
715+ def isJavaFile = pathLast.endsWith(" .java" )
710716 ! isHidden && (isScalaFile || isJavaFile)
711717 case _ => _ => true
712718 }
Original file line number Diff line number Diff line change 1+ package scala .build .errors
2+
3+ import com .swoval .files .PathWatchers
4+
5+ class WatchError (event : PathWatchers .Event , cause : Throwable = null )
6+ extends BuildException (
7+ message = s " Error watching paths with the PathWatchers.Event: $event" ,
8+ positions = Nil ,
9+ cause = cause
10+ )
You can’t perform that action at this time.
0 commit comments