@@ -17,18 +17,13 @@ import (
1717)
1818
1919func swiftCmd () * cobra.Command {
20- lockFiles := [][]string {
21- {"Package.resolved" , ".package.resolved" },
22- {"Package.swift.json" },
23- }
24- lockGenCommands := [][]string {
25- {"swift" , "package" , "resolve" },
26- {"swift" , "package" , "dump-package" },
27- }
28- commandOutput := []string {
29- "" ,
30- "Package.swift.json" ,
31- }
20+ deplockSwiftManifestDumpFile := "Package.swift.deplock"
21+ resolvedLockFiles := []string {"Package.resolved" , ".package.resolved" }
22+ deplockManifestDumpFiles := []string {deplockSwiftManifestDumpFile }
23+
24+ resolvedLockGenCommand := []string {"swift" , "package" , "resolve" }
25+ deplockManifestDumpGenCommand := []string {"swift" , "package" , "dump-package" }
26+
3227 forced := false
3328
3429 swiftCmd := & cobra.Command {
@@ -41,15 +36,21 @@ If no path is provided, the command defaults to the current directory.`,
4136
4237 Run : func (cmd * cobra.Command , args []string ) {
4338
44- for i := range lockFiles {
45- internal .CreateLockFile (
46- lockFiles [i ],
47- args ,
48- lockGenCommands [i ],
49- commandOutput [i ],
50- forced ,
51- )
52- }
39+ internal .CreateLockFile (
40+ resolvedLockFiles ,
41+ args ,
42+ resolvedLockGenCommand ,
43+ "" ,
44+ forced ,
45+ )
46+
47+ internal .CreateLockFile (
48+ deplockManifestDumpFiles ,
49+ args ,
50+ deplockManifestDumpGenCommand ,
51+ deplockSwiftManifestDumpFile ,
52+ forced ,
53+ )
5354
5455 },
5556 }
0 commit comments