From b5680cbfb740ad7a3addc894e0038b5b33e9b078 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Mon, 23 May 2022 10:37:12 +0100 Subject: [PATCH] Fix symlinks not fully cleaned up in Node.js tests (#349) `FileSystem.isDirectory` returns `false` when running it on broken symlinks, which breaks Node.js tests flow. We should be able to clean up all symlinks, even broken ones. Other we can't create new correct symlinks because broken symlinks already exist at those paths. --- Sources/CartonHelpers/FileSystem.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/CartonHelpers/FileSystem.swift b/Sources/CartonHelpers/FileSystem.swift index 7637f42..0d6101d 100644 --- a/Sources/CartonHelpers/FileSystem.swift +++ b/Sources/CartonHelpers/FileSystem.swift @@ -52,7 +52,7 @@ public extension FileSystem { func resourcesDirectoryNames(relativeTo buildDirectory: AbsolutePath) throws -> [String] { try getDirectoryContents(buildDirectory).filter { - $0.hasSuffix(".resources") && isDirectory(buildDirectory.appending(component: $0)) + $0.hasSuffix(".resources") } } }