diff --git a/SwiftShell/Command.swift b/SwiftShell/Command.swift index 60fce0b..3095f9e 100644 --- a/SwiftShell/Command.swift +++ b/SwiftShell/Command.swift @@ -150,7 +150,7 @@ extension NSTask { /** The full path to the executable + all arguments, each one quoted if it contains a space. */ func commandAsString () -> String? { guard let path = self.launchPath else { return nil } - return self.arguments?.reduce(path) { acc, arg in + return self.arguments?.reduce(path) { acc, arg in return acc + " " + ( arg.characters.contains(" ") ? ("\"" + arg + "\"") : arg ) } } diff --git a/SwiftShellTests/Context_Tests.swift b/SwiftShellTests/Context_Tests.swift index eec32a7..b4cb6ab 100644 --- a/SwiftShellTests/Context_Tests.swift +++ b/SwiftShellTests/Context_Tests.swift @@ -1,8 +1,8 @@ // -// Context_Tests.swift -// SwiftShell2 +// Context_Tests.swift +// SwiftShell2 // -// Created by Kåre Morstøl on 20.07.15. +// Created by Kåre Morstøl on 20.07.15. // // diff --git a/SwiftShellTests/General/Array_Tests.swift b/SwiftShellTests/General/Array_Tests.swift index 5086b5d..8b7d160 100644 --- a/SwiftShellTests/General/Array_Tests.swift +++ b/SwiftShellTests/General/Array_Tests.swift @@ -1,8 +1,8 @@ // -// Array_Tests.swift -// SwiftShell2 +// Array_Tests.swift +// SwiftShell2 // -// Created by Kåre Morstøl on 20.09.15. +// Created by Kåre Morstøl on 20.09.15. // //