Created
November 13, 2013 21:31
-
-
Save ricobeck/7456769 to your computer and use it in GitHub Desktop.
Getting the CocoaPods version with DSUnixTask - output is empty.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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]; | |
} |
Really strange, I can't see anything wrong with it. Have you checked how CocoaPods-objc does it? It is a bit outdated but the handshake should still work.
I tried it with a NSTask – also no output. So it's not a problem with DSUnixTask.
In CocoaPods-obc you used 'pod ipc repl' for communication. This prints the version as the first output so I have at least one other option. But at first I'd like to know what's wrong with the version output.
So pod ipc repl
works?
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
Console.app says: