Skip to content

Commit f296d1c

Browse files
committed
Better genstrings arguments
1 parent a0bd2dd commit f296d1c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

SCStringsUtility/SCStringsController.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,9 @@ - (void)importProjectAtPath:(NSString *)path
220220
[self executeGenStringsAtPath:[self.project.filePath stringByDeletingLastPathComponent] withRoutine:genstringsRoutine positionalParameters:includePositionalParameters];
221221
SCReader *genstringsOutputReader = [[SCReader alloc] initWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent:kKeyStringsFile]];
222222
NSString *comment, *key, *translation;
223-
while([genstringsOutputReader getNextComment:&comment key:&key translation:&translation])
223+
while([genstringsOutputReader getNextComment:&comment key:&key translation:&translation]) {
224224
[self.translationsDictionary setObject:[NSMutableDictionary dictionaryWithObject:comment forKey:kKeyComment] forKey:key];
225+
}
225226

226227
[self setFilteredTranslationsDictionary:[self.translationsDictionary mutableCopy]];
227228

@@ -238,7 +239,7 @@ -(void)executeGenStringsAtPath:(NSString*)path withRoutine:(NSString*)routine po
238239

239240
NSString *tempFilePath = NSTemporaryDirectory();
240241

241-
NSString *argument = [NSString stringWithFormat:@"find . -name '*.m' | xargs genstrings -o %@", tempFilePath];
242+
NSString *argument = [NSString stringWithFormat:@"find ./ -name *.m -print0| xargs -0 genstrings -o %@", tempFilePath];
242243
if([routine length]) argument = [argument stringByAppendingString:[NSString stringWithFormat:@" -s %@", routine]];
243244
if(!positionalParameters) argument = [argument stringByAppendingString:@" -noPositionalParameters"];
244245

0 commit comments

Comments
 (0)