Skip to content

Commit

Permalink
remove trailing slash in noGlobstarDirectory just in case
Browse files Browse the repository at this point in the history
  • Loading branch information
kyounh12 committed Apr 11, 2024
1 parent c1fd52b commit 0c154ff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/TuistSupport/Utils/Glob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ public class Glob: Collection {
// We should not find globstars in `noGlobstarDirectory` which definitely not contains globstars.
// This prevents an infinite loop when path contains a subdirectory named "**"
var noGlobstarComponentCount = 0
if let noGlobstarDirectory {
if var noGlobstarDirectory {
// Just in case
if noGlobstarDirectory.hasSuffix("/") {
noGlobstarDirectory.removeLast()
}

noGlobstarComponentCount = noGlobstarDirectory.components(separatedBy: "/").count
globstarCandidates.removeFirst(noGlobstarComponentCount)
}
Expand Down

0 comments on commit 0c154ff

Please sign in to comment.