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 {
NSTask *task = [[NSTask alloc] init];
task.launchPath = @"/bin/sh";
task.arguments = @[ @"-c", [NSString stringWithFormat:@"sleep %f; open \"%@\"", seconds, NSBundle.mainBundle.bundlePath] ];
[task launch];
[self terminate:nil];
NSArray *args = @[@"-c", [NSString stringWithFormat:@"sleep %f; open \"%@\"", seconds, NSBundle.mainBundle.bundlePath]];
[NSTask launchedTaskWithLaunchPath:@"/bin/sh" arguments:args];
[self terminate:self];
}
- (MPAppDelegate *)mp_delegate {