diff --git a/Scripts/EmojiGenerator.swift b/Scripts/EmojiGenerator.swift index c3c0473459..cbd3491706 100755 --- a/Scripts/EmojiGenerator.swift +++ b/Scripts/EmojiGenerator.swift @@ -1,9 +1,8 @@ +#!/usr/bin/env xcrun --sdk macosx swift // // Copyright (c) 2021 Open Whisper Systems. All rights reserved. // -#!/usr/bin/env xcrun --sdk macosx swift - import Foundation class EmojiGenerator { diff --git a/Scripts/precommit.py b/Scripts/precommit.py index 5b027f8c6b..b65f09e428 100755 --- a/Scripts/precommit.py +++ b/Scripts/precommit.py @@ -336,6 +336,12 @@ def process(filepath): text = sort_class_statements(filepath, filename, file_ext, text) lines = text.split('\n') + + shebang = "" + if lines[0].startswith('#!'): + shebang = lines[0] + '\n' + lines = lines[1:] + while lines and lines[0].startswith('//'): lines = lines[1:] text = '\n'.join(lines) @@ -348,7 +354,7 @@ def process(filepath): ''' % ( datetime.datetime.now().year, ) - text = header + text + '\n' + text = shebang + header + text + '\n' if original_text == text: return