Skip to content

Instantly share code, notes, and snippets.

@ricobeck
Created November 13, 2013 21:31
Show Gist options
  • Save ricobeck/7456769 to your computer and use it in GitHub Desktop.
Save ricobeck/7456769 to your computer and use it in GitHub Desktop.
Getting the CocoaPods version with DSUnixTask - output is empty.
- (void)checkCocoaPodsVersion
{
DSUnixShellTask *task = [DSUnixTaskSubProcessManager shellTask];
[[DSUnixTaskSubProcessManager sharedManager] setLoggingEnabled:YES];
[task setCommand:@"pod"];
[task setArguments:@[@"--version"]];
[task setStandardErrorHandler:^(DSUnixTask *task, NSString *error)
{
NSLog(@"DSUnixTask error: %@", error);
}];
[task setStandardOutputHandler:^(DSUnixTask *task, NSString *output)
{
NSLog(@"output\n%@\nfor task:%@", output, task);
}];
[task setTerminationHandler:^(DSUnixTask *task)
{
NSLog(@"termination handler for task %@", task);
NSLog(@"output: %@", task.standardOutput);
NSLog(@"output length: %lu", task.standardOutput.length);
}];
[task setFailureHandler:^(DSUnixTask *task)
{
NSLog(@"failure handler for task %@, error: %@", task, task.standardError);
}];
[task launch];
}
@ricobeck
Copy link
Author

Yes, thanks for pointing this out! This is now my temporarily solution.
I asked @alloy but he had no advice at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment