shortened relaunch NSTask invocation

This commit is contained in:
Michael Starke
2022-11-24 00:25:45 +01:00
parent 29756c00b3
commit bee3766f09

View File

@@ -55,11 +55,9 @@
} }
- (void)relaunchAfterDelay:(CGFloat)seconds { - (void)relaunchAfterDelay:(CGFloat)seconds {
NSTask *task = [[NSTask alloc] init]; NSArray *args = @[@"-c", [NSString stringWithFormat:@"sleep %f; open \"%@\"", seconds, NSBundle.mainBundle.bundlePath]];
task.launchPath = @"/bin/sh"; [NSTask launchedTaskWithLaunchPath:@"/bin/sh" arguments:args];
task.arguments = @[ @"-c", [NSString stringWithFormat:@"sleep %f; open \"%@\"", seconds, NSBundle.mainBundle.bundlePath] ]; [self terminate:self];
[task launch];
[self terminate:nil];
} }
- (MPAppDelegate *)mp_delegate { - (MPAppDelegate *)mp_delegate {