Skip to content

Commit aa96b38

Browse files
authored
Fix tuist init due to missing ProjectDescriptionHelpers (#6816)
1 parent fd959e5 commit aa96b38

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

Sources/TuistCore/Utils/RootDirectoryLocator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public final class RootDirectoryLocator: RootDirectoryLocating {
6262
return try await locate(from: path.parentDirectory, source: source)
6363
} else if let cachedDirectory = cached(path: path) {
6464
return cachedDirectory
65-
} else if try await fileSystem.exists(path.appending(component: Constants.tuistDirectoryName)) {
65+
} else if try await fileSystem.exists(path.appending(component: Constants.tuistDirectoryName), isDirectory: true) {
6666
cache(rootDirectory: path, for: source)
6767
return path
6868
} else if try await fileSystem.exists(path.appending(component: "Plugin.swift")) {

Tests/TuistCoreIntegrationTests/RootDirectoryLocatorIntegrationTests.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,20 @@ final class RootDirectoryLocatorIntegrationTests: TuistTestCase {
5858
XCTAssertEqual(got, temporaryDirectory.appending(try RelativePath(validating: "this")))
5959
}
6060

61+
func test_locate_when_a_tuist_file_is_present_not_directory() async throws {
62+
// Given
63+
let temporaryDirectory = try temporaryPath()
64+
try createFolders(["this/is/a/directory"])
65+
try createFiles(["this/is/a/directory/tuist"])
66+
67+
// When
68+
let got = try await subject
69+
.locate(from: temporaryDirectory.appending(try RelativePath(validating: "this/is/a/directory")))
70+
71+
// Then
72+
XCTAssertNil(got)
73+
}
74+
6175
func test_locate_when_multiple_tuist_directories_exists() async throws {
6276
// Given
6377
let temporaryDirectory = try temporaryPath()

0 commit comments

Comments
 (0)