From 9e1afa27ac1009244a2b968af3527ea8a7159b51 Mon Sep 17 00:00:00 2001 From: Euan Harris Date: Tue, 17 Jun 2025 13:34:52 +0100 Subject: [PATCH] generator: Quote paths when extracting Debian packages with Swift.run() --- Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator.swift b/Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator.swift index b14b61c..2839a82 100644 --- a/Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator.swift +++ b/Sources/SwiftSDKGenerator/Generator/SwiftSDKGenerator.swift @@ -163,12 +163,12 @@ public actor SwiftSDKGenerator { func rsync(from source: FilePath, to destination: FilePath) async throws { try self.createDirectoryIfNeeded(at: destination) - try await Shell.run("rsync -a \(source) \(destination)", shouldLogCommands: self.isVerbose) + try await Shell.run(#"rsync -a "\#(source)" "\#(destination)""#, shouldLogCommands: self.isVerbose) } func rsyncContents(from source: FilePath, to destination: FilePath) async throws { try self.createDirectoryIfNeeded(at: destination) - try await Shell.run("rsync -a \(source)/ \(destination)", shouldLogCommands: self.isVerbose) + try await Shell.run(#"rsync -a "\#(source)/" "\#(destination)""#, shouldLogCommands: self.isVerbose) } func createSymlink(at source: FilePath, pointingTo destination: FilePath) throws { @@ -254,7 +254,7 @@ public actor SwiftSDKGenerator { stripComponentsOption = "" } try await Shell.run( - #"tar -C "\#(directoryPath)" \#(stripComponentsOption) -xf \#(file)"#, + #"tar -C "\#(directoryPath)" \#(stripComponentsOption) -xf "\#(file)""#, shouldLogCommands: self.isVerbose ) }