Skip to content

Commit 328de7e

Browse files
authored
fix: update tests file without Plugin on the name (#39)
1 parent f9e43c8 commit 328de7e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Sources/CapacitorPluginTools/CapacitorPluginPackage.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,15 @@ public class CapacitorPluginPackage {
121121
print("Warning: file \(fileURL.path()) not found, trying PluginTests.swift")
122122
}
123123

124-
let backupFileURL = iosSrcDirectoryURL.appending(path: "PluginTests").appending(path: "PluginTests.swift")
124+
var backupFileURL = iosSrcDirectoryURL.appending(path: "PluginTests").appending(path: "PluginTests.swift")
125125

126+
if (try? backupFileURL.checkResourceIsReachable()) == true {
127+
return backupFileURL
128+
} else {
129+
print("Warning: file \(backupFileURL.path()) not found")
130+
}
131+
132+
backupFileURL = iosSrcDirectoryURL.appending(path: "PluginTests").appending(path: fileName.replacingOccurrences(of: "Plugin", with: ""))
126133
if (try? backupFileURL.checkResourceIsReachable()) == true {
127134
return backupFileURL
128135
}

0 commit comments

Comments
 (0)