File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -153,17 +153,18 @@ public struct SwiftPackageRegistryTool: ParsableCommand {
153
153
154
154
155
155
private extension SwiftTool {
156
- func getRegistriesConfig( sharedConfigurationDirectory: AbsolutePath ? = nil ) throws -> Workspace . Configuration . Registries {
157
- let sharedConfigurationDirectory = try sharedConfigurationDirectory ?? self . getSharedConfigurationDirectory ( )
158
- let sharedRegistriesFile = sharedConfigurationDirectory. map { Workspace . DefaultLocations. registriesConfigurationFile ( at: $0) }
156
+ func getRegistriesConfig( ) throws -> Workspace . Configuration . Registries {
157
+ let localRegistriesFile = try Workspace . DefaultLocations. registriesConfigurationFile ( at: self . getPackageRoot ( ) )
158
+
159
+ let workspace = try getActiveWorkspace ( )
160
+ let sharedRegistriesFile = workspace. location. sharedConfigurationDirectory. map {
161
+ Workspace . DefaultLocations. registriesConfigurationFile ( at: $0)
162
+ }
163
+
159
164
return try . init(
160
- localRegistriesFile: self . registriesConfigFile ( ) ,
165
+ localRegistriesFile: localRegistriesFile ,
161
166
sharedRegistriesFile: sharedRegistriesFile,
162
167
fileSystem: localFileSystem
163
168
)
164
169
}
165
-
166
- func registriesConfigFile( ) throws -> AbsolutePath {
167
- try self . getPackageRoot ( ) . appending ( components: " .swiftpm " , " config " , " registries.json " )
168
- }
169
170
}
Original file line number Diff line number Diff line change @@ -536,7 +536,7 @@ public class SwiftTool {
536
536
return netrcFilePath
537
537
}
538
538
539
- func getSharedCacheDirectory( ) throws -> AbsolutePath ? {
539
+ private func getSharedCacheDirectory( ) throws -> AbsolutePath ? {
540
540
if let explicitCachePath = options. cachePath {
541
541
// Create the explicit cache path if necessary
542
542
if !localFileSystem. exists ( explicitCachePath) {
@@ -553,7 +553,7 @@ public class SwiftTool {
553
553
}
554
554
}
555
555
556
- func getSharedConfigurationDirectory( ) throws -> AbsolutePath ? {
556
+ private func getSharedConfigurationDirectory( ) throws -> AbsolutePath ? {
557
557
if let explicitConfigPath = options. configPath {
558
558
// Create the explicit config path if necessary
559
559
if !localFileSystem. exists ( explicitConfigPath) {
You can’t perform that action at this time.
0 commit comments