Skip to content

Commit

Permalink
Launch the doctor within Terminal as a temporary fix for issue #374.
Browse files Browse the repository at this point in the history
  • Loading branch information
edgy360 committed Sep 18, 2014
1 parent f7fd9e7 commit 0bf0302
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions Appium/Server/Model/AppiumModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ typedef enum platformTypes
-(BOOL) killServer;
-(BOOL) startServer;
-(BOOL) startDoctor;
- (void)startExternalDoctor;
-(void) reset;
- (void)setupServerTask:(NSString *)commandString;

Expand Down
19 changes: 19 additions & 0 deletions Appium/Server/Model/AppiumModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,25 @@ -(BOOL) startDoctor
return self.serverTask.isRunning;
}

- (void)startExternalDoctor
{
NSString *doctorPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/node_modules/appium/bin/appium-doctor.js"];

NSString *command;

if (self.developer.useExternalNodeJSBinary)
{
command = [NSString stringWithFormat:@"'%@' '%@'", self.developer.externalNodeJSBinaryPath, doctorPath];
}
else
{
command = [NSString stringWithFormat:@"'%@%@' '%@'", [[NSBundle mainBundle] resourcePath], @"/node/bin/node", doctorPath];
}

NSAppleScript *script = [[NSAppleScript alloc] initWithSource:[NSString stringWithFormat:@"tell application \"Terminal\" to do script \"%@\"\nactivate application \"Terminal\"", command]];
[script executeAndReturnError:nil];
}

- (void)setupServerTask:(NSString *)commandString
{
[self setServerTask:[NSTask new]];
Expand Down
4 changes: 4 additions & 0 deletions Appium/Server/Monitor/AppiumMonitorWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ - (IBAction) launchButtonClicked:(id)sender

-(IBAction)doctorButtonClicked:(id)sender
{
// Prevent startDoctor from being run for now due to issue #374
[self.model startExternalDoctor];
return;

if ([self.model startDoctor])
{
[self closeAllPopovers];
Expand Down

0 comments on commit 0bf0302

Please sign in to comment.