TM-SGNL-iOS/Scripts/check_xcode_version.py
TeleMessage developers dde0620daf initial commit
2025-05-03 12:28:28 -07:00

28 lines
639 B
Python
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env python3
import subprocess
def get_actual_version():
return subprocess.run(
["xcodebuild", "-version"], check=True, capture_output=True, encoding="utf8"
).stdout.split("\n")[0]
def get_expected_version():
with open(".xcode-version", "r") as file:
return file.read().rstrip()
def main():
actual_version = get_actual_version()
expected_version = get_expected_version()
if actual_version != expected_version:
print(
f"Youre using {actual_version} but you should be using {expected_version}."
)
exit(1)
if __name__ == "__main__":
main()