Skip to content

Commit

Permalink
Fix find logic in localize.py
Browse files Browse the repository at this point in the history
We need to use parentheses to be sure that the -print0 is applied to the whole expression

Otherwise only the RHS of the -o OR expression will have the -print0 applied, which means we will only print .swift files and not print .m files at all
  • Loading branch information
AliSoftware committed Sep 21, 2021
1 parent 0159d86 commit b1ca6fb
Show file tree
Hide file tree
Showing 2 changed files with 209 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Scripts/localize.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def localize(path):
new = original + '.new'

# Using with `-print0` and `xargs -0` to account for spaces in the paths `find` might return
genstrings_cmd = 'find ./Simplenote ./SimplenoteShare ./SimplenoteWidgets -name "*.m" -o -name "*.swift" -print0 | xargs -0 genstrings -q -o "%s"'
genstrings_cmd = 'find ./Simplenote ./SimplenoteShare ./SimplenoteWidgets \( -name "*.m" -o -name "*.swift" \) -print0 | xargs -0 genstrings -q -o "%s"'

if os.path.isfile(original):
os.rename(original, old)
Expand Down
Loading

0 comments on commit b1ca6fb

Please sign in to comment.