2022-12-14 12:55:44 +03:00
|
|
|
import sys
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
|
|
def patch_installer(tag: str):
|
|
|
|
"""Patches the installer with the correct connector version and specklepy version"""
|
|
|
|
tag = tag.replace("\n", "")
|
|
|
|
iss_file = "speckle-sharp-ci-tools/blender.iss"
|
2024-11-05 16:09:38 +03:00
|
|
|
iss_path = Path(iss_file)
|
2022-12-14 12:55:44 +03:00
|
|
|
lines = iss_path.read_text().split("\n")
|
|
|
|
lines.insert(12, f'#define AppVersion "{tag.split("-")[0]}"')
|
|
|
|
lines.insert(13, f'#define AppInfoVersion "{tag}"')
|
|
|
|
|
|
|
|
iss_path.write_text("\n".join(lines))
|
|
|
|
print(f"Patched installer with connector v{tag}")
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
tag = sys.argv[1]
|
2024-11-05 16:09:38 +03:00
|
|
|
patch_installer(tag)
|