Skip to content

Commit

Permalink
better path handling of processes
Browse files Browse the repository at this point in the history
  • Loading branch information
tessus committed Jul 3, 2015
1 parent cc3b9fd commit 8c432bf
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions Classes/mysqlPref.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,17 @@ - (void)mainViewDidLoad {
//NSLog(@"arguments (MySQL): %@", arguments);

NSString *lp = [[MSPPPreferences sharedPreferences] objectForUserDefaultsKey:@"launchPath"];
if ([lp hasSuffix:@"/"])
{
daemonController.launchPathStart = [lp stringByAppendingString:@"mysqld_safe"];
daemonController.launchPath = [lp stringByAppendingString:@"mysqld"];
}
else
{
daemonController.launchPathStart = [lp stringByAppendingString:@"/mysqld_safe"];
daemonController.launchPath = [lp stringByAppendingString:@"/mysqld"];
}

daemonController.launchPathStart = [lp stringByAppendingString:@"mysqld_safe"];
daemonController.launchPath = [lp stringByAppendingString:@"mysqld"];
daemonController.startArguments = arguments;

[versionText setTitle:version];
Expand Down Expand Up @@ -109,7 +117,14 @@ - (IBAction)startStopDaemon:(id)sender {
NSMutableArray *arguments = (NSMutableArray *)[[MSPPPreferences sharedPreferences] argumentsWithParameters];

NSString *lp = [[MSPPPreferences sharedPreferences] objectForUserDefaultsKey:@"launchPath"];
daemonController.launchPath = [lp stringByAppendingString:@"mysqld"];
if ([lp hasSuffix:@"/"])
{
daemonController.launchPath = [lp stringByAppendingString:@"mysqld"];
}
else
{
daemonController.launchPath = [lp stringByAppendingString:@"/mysqld"];
}
daemonController.startArguments = arguments;

if (theSlider.state == NSOffState)
Expand All @@ -125,7 +140,14 @@ - (IBAction)clickOnOff:(id)sender {
NSMutableArray *arguments = (NSMutableArray *)[[MSPPPreferences sharedPreferences] argumentsWithParameters];

NSString *lp = [[MSPPPreferences sharedPreferences] objectForUserDefaultsKey:@"launchPath"];
daemonController.launchPath = [lp stringByAppendingString:@"mysqld"];
if ([lp hasSuffix:@"/"])
{
daemonController.launchPath = [lp stringByAppendingString:@"mysqld"];
}
else
{
daemonController.launchPath = [lp stringByAppendingString:@"/mysqld"];
}
daemonController.startArguments = arguments;

int tag = (int)[sender tag];
Expand Down

0 comments on commit 8c432bf

Please sign in to comment.