Skip to content

Commit 238c5e4

Browse files
committed
Quote space-containing arguments in Task.description
1 parent d5be89d commit 238c5e4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ReactiveTask/Task.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ public struct Task {
4848

4949
extension Task: CustomStringConvertible {
5050
public var description: String {
51+
let arguments = self.arguments.map { argument -> String in
52+
if argument.containsString(" ") {
53+
return "\"\(argument)\""
54+
} else {
55+
return argument
56+
}
57+
}
5158
return "\(launchPath) \(arguments.joinWithSeparator(" "))"
5259
}
5360
}

0 commit comments

Comments
 (0)