Check that the executable exists before running it.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@37468 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2013-12-17 16:49:10 +00:00
parent 907f26aab5
commit c7e5eeba89
2 changed files with 19 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2013-12-17 Riccardo Mottola <rm@gnu.org>
* Framework/PCProjectLauncher.m
Check that the executable exists before running it.
2013-10-20 German Arias <germanandre@gmx.es>
* English.lproj/Preferences.gorm:

View file

@ -290,6 +290,7 @@ enum {
NSPipe *logPipe;
NSPipe *errorPipe;
NSString *executablePath;
NSFileManager *fm;
executablePath = [NSMutableString stringWithString:[project projectPath]];
@ -327,6 +328,19 @@ enum {
return;
}
NSLog(@"executable launch path: %@", executablePath);
/* now check if the executable does exist. Perhaps make failed */
fm = [NSFileManager defaultManager];
if (![fm isExecutableFileAtPath:executablePath])
{
NSRunAlertPanel(@"Run",
@"The project does not have an executable",
@"Close", nil, nil, nil);
[runButton setState:NSOffState];
return;
}
// [makeTask isRunning] doesn't work here.
// "waitpid 7045, result -1, error No child processes" is printed.
if (launchTask)