Skip to content

Commit 061be83

Browse files
authored
bugfix: Check if last segment of path exists (#3131)
I am not sure why this wouldn't work with `os.root`, but at least this should not throw. Should fix #2758
1 parent dab5d9e commit 061be83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/build/src/main/scala/scala/build/input/Inputs.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,6 @@ object Inputs {
476476
def empty(projectName: String): Inputs =
477477
Inputs(Nil, None, os.pwd, projectName, false, None, true, false)
478478

479-
def baseName(p: os.Path) = if (p == os.root) "" else p.baseName
479+
def baseName(p: os.Path) = if (p == os.root || p.lastOpt.isEmpty) "" else p.baseName
480480

481481
}

0 commit comments

Comments
 (0)