Skip to content

Commit

Permalink
fixed relative path calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex da Franca committed Mar 20, 2022
1 parent 9d30dbd commit ecde9b6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/xcresultparser/CoverageConverter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ public struct CoverageConverter {
guard !projectRoot.isEmpty else {
return path
}
let parts = path.components(separatedBy: "/\(projectRoot)")
let projectRootTrimmed = projectRoot.trimmingCharacters(in: CharacterSet(charactersIn: "/"))
let parts = path.components(separatedBy: "/\(projectRootTrimmed)")
guard parts.count > 1 else {
return path
}
Expand Down

0 comments on commit ecde9b6

Please sign in to comment.