Skip to content

Commit

Permalink
recognize project selection by path by looking at all (re-)source fol…
Browse files Browse the repository at this point in the history
…ders (#379)
  • Loading branch information
oyvindberg committed Jun 2, 2024
1 parent 784f3ed commit 9eaa10f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bleep-core/src/scala/bleep/bootstrap.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ object bootstrap {
else {
val chosen =
build.explodedProjects.flatMap { case (crossProjectName, p) =>
val folder = pre.buildPaths.project(crossProjectName, p).dir
if (folder.startsWith(pre.buildPaths.cwd)) Some(crossProjectName)
val projectPaths = pre.buildPaths.project(crossProjectName, p)
val underFolder = projectPaths.dir.startsWith(pre.buildPaths.cwd)
def underSources = projectPaths.sourcesDirs.all.exists(_.startsWith(pre.buildPaths.cwd))
def underResources = projectPaths.resourcesDirs.all.exists(_.startsWith(pre.buildPaths.cwd))
val underAny = underFolder || underSources || underResources
if (underAny) Some(crossProjectName)
else None
}.toArray

Expand Down

0 comments on commit 9eaa10f

Please sign in to comment.