diff --git a/ChangeLog b/ChangeLog index f52e28d..722644a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-12-17 Riccardo Mottola + + * Framework/PCProjectLauncher.m + Check that the executable exists before running it. + 2013-10-20 German Arias * English.lproj/Preferences.gorm: diff --git a/Framework/PCProjectLauncher.m b/Framework/PCProjectLauncher.m index dc8367b..343d5e6 100644 --- a/Framework/PCProjectLauncher.m +++ b/Framework/PCProjectLauncher.m @@ -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)