File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -508,15 +508,19 @@ public final class ToolchainRegistry: @unchecked Sendable {
508
508
/// Look up the toolchain with the given identifier.
509
509
public func lookup( _ identifier: String ) -> Toolchain ? {
510
510
let lowercasedIdentifier = identifier. lowercased ( )
511
- if [ " default " , " xcode " ] . contains ( lowercasedIdentifier ) {
512
- if hostOperatingSystem == . macOS {
511
+ if hostOperatingSystem == . macOS {
512
+ if [ " default " , " xcode " ] . contains ( lowercasedIdentifier ) {
513
513
return toolchainsByIdentifier [ ToolchainRegistry . defaultToolchainIdentifier] ?? toolchainsByAlias [ lowercasedIdentifier]
514
514
} else {
515
- // On non-Darwin, assume if there is only one registered toolchain, it is the default.
516
- return toolchainsByIdentifier [ ToolchainRegistry . defaultToolchainIdentifier] ?? toolchainsByAlias [ lowercasedIdentifier] ?? toolchainsByIdentifier. values. only
515
+ return toolchainsByIdentifier [ identifier] ?? toolchainsByAlias [ lowercasedIdentifier]
517
516
}
518
517
} else {
519
- return toolchainsByIdentifier [ identifier] ?? toolchainsByAlias [ lowercasedIdentifier]
518
+ // On non-Darwin, assume if there is only one registered toolchain, it is the default.
519
+ if [ " default " , " xcode " ] . contains ( lowercasedIdentifier) || identifier == ToolchainRegistry . defaultToolchainIdentifier {
520
+ return toolchainsByIdentifier [ ToolchainRegistry . defaultToolchainIdentifier] ?? toolchainsByAlias [ lowercasedIdentifier] ?? toolchainsByIdentifier. values. only
521
+ } else {
522
+ return toolchainsByIdentifier [ identifier] ?? toolchainsByAlias [ lowercasedIdentifier]
523
+ }
520
524
}
521
525
}
522
526
You can’t perform that action at this time.
0 commit comments