Skip to content

Commit 1f15371

Browse files
authored
fix: Remove unused files (#7)
This PR removes some project/CocoaPods files that are no longer needed in SPM, only if no-backup is selected. At the moment it fails to delete the test's Info.plist, #6 should be merged first as it moves the copying of the test folder after the backup/deletion of files.
1 parent 6ef7cf9 commit 1f15371

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/cap2spm.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,14 @@ struct Cap2SPM: ParsableCommand {
5353
try modifySwiftFile(at: swiftFileURL, plugin: capPlugin)
5454
try generatePackageSwiftFile(at: packageSwiftFileURL, plugin: capPlugin)
5555

56-
let fileList = [mFileURL, hFileURL]
56+
var fileList = [mFileURL, hFileURL]
5757
if shouldBackup {
5858
try fileBackup(of: fileList)
5959
} else {
60+
let oldFiles = ["Plugin/Info.plist", "PluginTests/Info.plist", "Plugin.xcodeproj", "Plugin.xcworkspace", "Podfile"].compactMap {
61+
capacitorPluginPackage.iosSrcDirectoryURL.appending(path: $0)
62+
}
63+
fileList.append(contentsOf: oldFiles)
6064
try fileDelete(of: fileList)
6165
}
6266
try moveItemCreatingIntermediaryDirectories(at: capacitorPluginPackage.iosSrcDirectoryURL.appending(path: "Plugin"), to: capacitorPluginPackage.iosSrcDirectoryURL.appending(path: "Sources").appending(path: capPlugin.identifier))

0 commit comments

Comments
 (0)