Skip to content

Commit

Permalink
bugfix: Check if last segment of path exists
Browse files Browse the repository at this point in the history
I am not sure why this wouldn't work with `os.root`, but at least this should not throw.

Should fix #2758
  • Loading branch information
tgodzik committed Aug 27, 2024
1 parent c709cf6 commit 655cb4f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,6 @@ object Inputs {
def empty(projectName: String): Inputs =
Inputs(Nil, None, os.pwd, projectName, false, None, true, false)

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

}

0 comments on commit 655cb4f

Please sign in to comment.