-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve error messages #22
Conversation
Bridgecraft/Utils.swift
Outdated
var buffer = Data() | ||
while ps.isRunning { | ||
buffer.append(pipe.fileHandleForReading.readDataToEndOfFile()) | ||
ps.waitUntilExit() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid waitUntilExit
cannot be used here since it depends on a runloop being installed on the current thread
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Bridgecraft/Utils.swift
Outdated
let errorPipeResult = errorPipe.fileHandleForReading.readDataToEndOfFile() | ||
|
||
guard let output = String(data: outputPipeResult, encoding: String.Encoding.utf8), | ||
let error = String(data: errorPipeResult, encoding: String.Encoding.utf8) else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coud you please reformat this like:
guard
xxx,
yyy
else {
zzz
}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. The Xcode auto-formatting put it like this:
guard
xxx,
yyy
else {
zzz
}
It is ok? Or should I change it?
👍 |
Hello, this PR fixes #20.
It show's more explicit errors and add a verbose flag that prints all shell commands and the respective responses.
Here is an example of how the error are showed now: