File tree Expand file tree Collapse file tree 2 files changed +15
-32
lines changed
Sources/SwiftSDKGenerator Expand file tree Collapse file tree 2 files changed +15
-32
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,20 @@ extension SwiftSDKGenerator {
73
73
] )
74
74
}
75
75
76
+ private func getXzPath( ) -> String ? {
77
+ #if os(macOS)
78
+ let xzPath = " /opt/homebrew/bin/xz "
79
+ #else
80
+ let xzPath = " /usr/bin/xz "
81
+ #endif
82
+
83
+ if doesFileExist ( at: FilePath ( xzPath) ) {
84
+ return xzPath
85
+ }
86
+
87
+ return nil
88
+ }
89
+
76
90
func downloadUbuntuPackages(
77
91
_ client: some HTTPClientProtocol ,
78
92
_ engine: QueryEngine ,
@@ -83,7 +97,7 @@ extension SwiftSDKGenerator {
83
97
logger. debug ( " Parsing Ubuntu packages list... " )
84
98
85
99
// Find xz path
86
- let xzPath = try await which ( " xz " )
100
+ let xzPath = getXzPath ( )
87
101
if xzPath == nil {
88
102
logger. warning ( """
89
103
The 'xz' utility was not found in path. \
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments