From f296d1c6a737a64f6475d9684664b2f342b0ec1a Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Mon, 2 Sep 2013 08:52:20 +0100 Subject: [PATCH] Better genstrings arguments --- SCStringsUtility/SCStringsController.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SCStringsUtility/SCStringsController.m b/SCStringsUtility/SCStringsController.m index c1d203f..2a17928 100644 --- a/SCStringsUtility/SCStringsController.m +++ b/SCStringsUtility/SCStringsController.m @@ -220,8 +220,9 @@ - (void)importProjectAtPath:(NSString *)path [self executeGenStringsAtPath:[self.project.filePath stringByDeletingLastPathComponent] withRoutine:genstringsRoutine positionalParameters:includePositionalParameters]; SCReader *genstringsOutputReader = [[SCReader alloc] initWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:kKeyStringsFile]]; NSString *comment, *key, *translation; - while([genstringsOutputReader getNextComment:&comment key:&key translation:&translation]) + while([genstringsOutputReader getNextComment:&comment key:&key translation:&translation]) { [self.translationsDictionary setObject:[NSMutableDictionary dictionaryWithObject:comment forKey:kKeyComment] forKey:key]; + } [self setFilteredTranslationsDictionary:[self.translationsDictionary mutableCopy]]; @@ -238,7 +239,7 @@ -(void)executeGenStringsAtPath:(NSString*)path withRoutine:(NSString*)routine po NSString *tempFilePath = NSTemporaryDirectory(); - NSString *argument = [NSString stringWithFormat:@"find . -name '*.m' | xargs genstrings -o %@", tempFilePath]; + NSString *argument = [NSString stringWithFormat:@"find ./ -name *.m -print0| xargs -0 genstrings -o %@", tempFilePath]; if([routine length]) argument = [argument stringByAppendingString:[NSString stringWithFormat:@" -s %@", routine]]; if(!positionalParameters) argument = [argument stringByAppendingString:@" -noPositionalParameters"];