Skip to content

Commit 6ef7cf9

Browse files
authored
fix: Move whole Plugin folder to Sources (#6)
The previous PR only moved the plugin class to the Sources folder, but some plugins have multiple swift files, so this PR moves the whole Plugin folder into the Sources folder
1 parent c4b20b8 commit 6ef7cf9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/cap2spm.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ struct Cap2SPM: ParsableCommand {
5151
guard let capPlugin = capacitorPluginPackage.oldPlugin?.capacitorPlugin else { return }
5252

5353
try modifySwiftFile(at: swiftFileURL, plugin: capPlugin)
54-
try moveItemCreatingIntermediaryDirectories(at: swiftFileURL, to: capacitorPluginPackage.iosSrcDirectoryURL.appending(path: "Sources").appending(path: capPlugin.identifier).appending(path: swiftFileURL.lastPathComponent))
55-
try moveItemCreatingIntermediaryDirectories(at: capacitorPluginPackage.iosSrcDirectoryURL.appending(path: "PluginTests"), to: capacitorPluginPackage.iosSrcDirectoryURL.appending(path: "Tests").appending(path: "\(capPlugin.identifier)Tests"))
5654
try generatePackageSwiftFile(at: packageSwiftFileURL, plugin: capPlugin)
5755

5856
let fileList = [mFileURL, hFileURL]
@@ -61,6 +59,8 @@ struct Cap2SPM: ParsableCommand {
6159
} else {
6260
try fileDelete(of: fileList)
6361
}
62+
try moveItemCreatingIntermediaryDirectories(at: capacitorPluginPackage.iosSrcDirectoryURL.appending(path: "Plugin"), to: capacitorPluginPackage.iosSrcDirectoryURL.appending(path: "Sources").appending(path: capPlugin.identifier))
63+
try moveItemCreatingIntermediaryDirectories(at: capacitorPluginPackage.iosSrcDirectoryURL.appending(path: "PluginTests"), to: capacitorPluginPackage.iosSrcDirectoryURL.appending(path: "Tests").appending(path: "\(capPlugin.identifier)Tests"))
6464
}
6565

6666
private func fileBackup(of fileURLs: [URL]) throws {

0 commit comments

Comments
 (0)