diff --git a/Tools/XcodeCapp/TNXCodeCapp.m b/Tools/XcodeCapp/TNXCodeCapp.m index ffe2d1cab..2ecee5fdc 100644 --- a/Tools/XcodeCapp/TNXCodeCapp.m +++ b/Tools/XcodeCapp/TNXCodeCapp.m @@ -460,14 +460,23 @@ NSString * const XCCListeningStartNotification = @"XCCListeningStartNotification [PBXContent writeToFile:XCodeSupportPBXPath atomically:YES encoding:NSUTF8StringEncoding error:nil]; DLog(@"PBX file adapted to the project"); - DLog(@"Creating source folder %@", [XCodeSupportProjectSources path]); - [fm createDirectoryAtPath:[XCodeSupportProjectSources path] withIntermediateDirectories:YES attributes:nil error:nil]; + [self createXcodeSupportProjectSourcesDirIfNecessary]; return NO; } + [self createXcodeSupportProjectSourcesDirIfNecessary]; return YES; } +/*! + Create the xCodeSupport/Sources folder if necessary. + */ +- (void)createXcodeSupportProjectSourcesDirIfNecessary { + if ([fm fileExistsAtPath:[XCodeSupportProjectSources path]]) return; + DLog(@"Creating source folder %@", [XCodeSupportProjectSources path]); + [fm createDirectoryAtPath:[XCodeSupportProjectSources path] withIntermediateDirectories:YES attributes:nil error:nil]; +} + /*! Initialize the creation of the .xCodeSupport project. This Operation is threaded