Skip to content

Commit

Permalink
Add code comment about -littleEndian
Browse files Browse the repository at this point in the history
Co-authored-by: Gio Lodi <[email protected]>
  • Loading branch information
AliSoftware and mokagio committed Sep 12, 2024
1 parent dec7b52 commit 4d955f1
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ def self.run(params)
Dir.mktmpdir('genstrings-output-') do |tmpdir|
# Build the command arguments
files = files_matching(paths: params[:paths], exclude: params[:exclude])
flags = [('-q' if params[:quiet]), ('-SwiftUI' if params[:swiftui]), '-littleEndian'].compact
flags = [
('-q' if params[:quiet]),
('-SwiftUI' if params[:swiftui]),
# If no endianness (-bigEndian vs -littleEndian) is specified, genstrings will use endianness of the current OS.
# Currently, genstrings runs only on macOS, which is little-endian, so this parameter is not strictly necessary.
# We make it explicit here to raise visibility on the relationship between the endianness of the genstring output and that of the encoding later on.
'-littleEndian'
].compact
flags += Array(params[:routines]).flat_map { |routine| ['-s', routine] }
cmd = ['genstrings', '-o', tmpdir, *flags, *files]

Expand Down

0 comments on commit 4d955f1

Please sign in to comment.