Skip to content

Commit 9e1afa2

Browse files
committed
generator: Quote paths when extracting Debian packages with Swift.run()
1 parent af1bea6 commit 9e1afa2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ public actor SwiftSDKGenerator {
163163

164164
func rsync(from source: FilePath, to destination: FilePath) async throws {
165165
try self.createDirectoryIfNeeded(at: destination)
166-
try await Shell.run("rsync -a \(source) \(destination)", shouldLogCommands: self.isVerbose)
166+
try await Shell.run(#"rsync -a "\#(source)" "\#(destination)""#, shouldLogCommands: self.isVerbose)
167167
}
168168

169169
func rsyncContents(from source: FilePath, to destination: FilePath) async throws {
170170
try self.createDirectoryIfNeeded(at: destination)
171-
try await Shell.run("rsync -a \(source)/ \(destination)", shouldLogCommands: self.isVerbose)
171+
try await Shell.run(#"rsync -a "\#(source)/" "\#(destination)""#, shouldLogCommands: self.isVerbose)
172172
}
173173

174174
func createSymlink(at source: FilePath, pointingTo destination: FilePath) throws {
@@ -254,7 +254,7 @@ public actor SwiftSDKGenerator {
254254
stripComponentsOption = ""
255255
}
256256
try await Shell.run(
257-
#"tar -C "\#(directoryPath)" \#(stripComponentsOption) -xf \#(file)"#,
257+
#"tar -C "\#(directoryPath)" \#(stripComponentsOption) -xf "\#(file)""#,
258258
shouldLogCommands: self.isVerbose
259259
)
260260
}

0 commit comments

Comments
 (0)