File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ extension SystemPackageProvider {
189
189
}
190
190
191
191
var isAvailable : Bool {
192
- guard let platform = Platform . currentPlatform ( ) else { return false }
192
+ guard let platform = Platform . currentPlatform else { return false }
193
193
switch self {
194
194
case . Brew( _) :
195
195
if case . Darwin = platform {
Original file line number Diff line number Diff line change @@ -18,7 +18,9 @@ public enum Platform {
18
18
case Debian
19
19
}
20
20
21
- public static func currentPlatform( ) -> Platform ? {
21
+ // Lazily return current platform.
22
+ public static var currentPlatform = Platform . findCurrentPlatform ( )
23
+ private static func findCurrentPlatform( ) -> Platform ? {
22
24
guard let uname = try ? popen ( [ " uname " ] ) . chomp ( ) . lowercased ( ) else { return nil }
23
25
switch uname {
24
26
case " darwin " :
You can’t perform that action at this time.
0 commit comments