Skip to content

Commit

Permalink
fixes stdout truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
iosdeveloper committed Jun 22, 2016
1 parent a7d0d76 commit 6f28a41
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions App/BitBar/ExecutablePlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,18 @@ - (BOOL)refreshContentByExecutingCommand:(NSArray<NSString *> *)args {
}

[task waitUntilExit];

//NSData *stdoutData = [[stdoutPipe fileHandleForReading] readDataToEndOfFile];
NSData *stderrData = [[stderrPipe fileHandleForReading] readDataToEndOfFile];

[[NSNotificationCenter defaultCenter] removeObserver:self name:NSFileHandleDataAvailableNotification object:stdoutPipe.fileHandleForReading];

//self.content = [NSString.alloc initWithData:stdoutData encoding:NSUTF8StringEncoding];
NSData *stdoutData = [[stdoutPipe fileHandleForReading] readDataToEndOfFile];
NSData *stderrData = [[stderrPipe fileHandleForReading] readDataToEndOfFile];

NSString *content = [[NSString alloc] initWithData:stdoutData encoding:NSUTF8StringEncoding];

if (content) {
self.content = [self.content stringByAppendingString:content];
}

self.errorContent = [NSString.alloc initWithData:stderrData encoding:NSUTF8StringEncoding];

// failure
Expand Down

0 comments on commit 6f28a41

Please sign in to comment.