mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-19 09:02:02 +00:00
leaned up the writeMakefile method
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@11909 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
cdcc6ced81
commit
c574c7cae4
1 changed files with 11 additions and 18 deletions
|
@ -87,26 +87,19 @@
|
|||
- (BOOL)writeMakefile
|
||||
{
|
||||
NSFileManager *fm = [NSFileManager defaultManager];
|
||||
NSString *makefile = [[self projectPath] stringByAppendingPathComponent:@"GNUmakefile"];
|
||||
NSData *content;
|
||||
NSData *mfd;
|
||||
NSString *mf = [projectPath stringByAppendingPathComponent:@"GNUmakefile"];
|
||||
|
||||
if (![super writeMakefile]) {
|
||||
NSLog(@"Couldn't update PC.project...");
|
||||
}
|
||||
// Save the project file
|
||||
[super writeMakefile];
|
||||
|
||||
if (mfd = [[PCLibMakefileFactory sharedFactory] makefileForProject:self]) {
|
||||
if ([mfd writeToFile:mf atomically:YES]) {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
if (![fm movePath:makefile toPath:[projectPath stringByAppendingPathComponent:@"GNUmakefile~"] handler:nil]) {
|
||||
NSLog(@"Couldn't write a backup GNUmakefile...");
|
||||
}
|
||||
|
||||
if (!(content = [[PCLibMakefileFactory sharedFactory] makefileForProject:self])) {
|
||||
NSLog([NSString stringWithFormat:@"Couldn't build the GNUmakefile %@!",makefile]);
|
||||
return NO;
|
||||
}
|
||||
if (![content writeToFile:makefile atomically:YES]) {
|
||||
NSLog([NSString stringWithFormat:@"Couldn't write the GNUmakefile %@!",makefile]);
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)isValidDictionary:(NSDictionary *)aDict
|
||||
|
|
Loading…
Reference in a new issue