File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -488,13 +488,18 @@ public class SwiftTool {
488
488
func getNetrcConfig( ) -> Workspace . Configuration . Netrc ? {
489
489
guard options. netrc else { return nil }
490
490
491
- let path = options. netrcFilePath ?? localFileSystem . homeDirectory . appending ( component : " .netrc " )
492
- guard localFileSystem. exists ( path ) else {
493
- ObservabilitySystem . topScope. emit ( warning: " Did not find .netrc file at \( path ) . " )
494
- return nil
495
- }
491
+ if let configuredPath = options. netrcFilePath {
492
+ guard localFileSystem. exists ( configuredPath ) else {
493
+ ObservabilitySystem . topScope. emit ( warning: " Did not find .netrc file at \( configuredPath ) . " )
494
+ return nil
495
+ }
496
496
497
- return . init( path: path, fileSystem: localFileSystem)
497
+ return . init( path: configuredPath, fileSystem: localFileSystem)
498
+ } else {
499
+ let defaultPath = localFileSystem. homeDirectory. appending ( component: " .netrc " )
500
+
501
+ return . init( path: defaultPath, fileSystem: localFileSystem)
502
+ }
498
503
}
499
504
500
505
private func getSharedCacheDirectory( ) throws -> AbsolutePath ? {
You can’t perform that action at this time.
0 commit comments