We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 375d21f + 9e4b12e commit cc4b2e2Copy full SHA for cc4b2e2
1 file changed
ReactiveTask/Task.swift
@@ -46,9 +46,19 @@ public struct Task {
46
}
47
48
49
+private extension String {
50
+ var escaped: String {
51
+ if rangeOfCharacterFromSet(.whitespaceCharacterSet()) != nil {
52
+ return "\"\(self)\""
53
+ } else {
54
+ return self
55
+ }
56
57
+}
58
+
59
extension Task: CustomStringConvertible {
60
public var description: String {
- return "\(launchPath) \(arguments.joinWithSeparator(" "))"
61
+ return "\(launchPath) \(arguments.map { $0.escaped }.joinWithSeparator(" "))"
62
63
64
0 commit comments