Skip to content

Commit

Permalink
Merge pull request #57 from alcarithemad/newlines-fix
Browse files Browse the repository at this point in the history
Rewrite Entitlements.plist to avoid newline issues.
  • Loading branch information
freakboy3742 authored May 22, 2024
2 parents a0ff222 + 228fed0 commit c8d3fef
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,16 @@
# Delete all remaining stubs
for stub in BIN_PATH.glob("Stub-*"):
os.unlink(stub)

# The codesign utility in recent macOS fails with obscure errors when presented with
# CRLF line endings, but in some configurations (e.g. global `core.autocrlf=true`)
# git may have checked out this repo in a way that put CRLF line endings in Entitlements.plist.
# The following is thus a no-op most of the time, but it's a simple rewrite of a small file.
ENTITLEMENTS_PATH = Path("Entitlements.plist")
# This implicitly uses "universal" newlines mode.
xml_content = ENTITLEMENTS_PATH.read_text()
ENTITLEMENTS_PATH.open('w', newline='\n').write(xml_content)

INFO_PATH = BIN_PATH.parent / 'Info.plist'
info_content = INFO_PATH.read_text()
INFO_PATH.open('w', newline='\n').write(info_content)

0 comments on commit c8d3fef

Please sign in to comment.