1
0
Fork 0
mirror of https://github.com/ArtemSBulgakov/buildozer-action.git synced 2024-08-16 10:09:52 +02:00
gh-buildozer-action/patches.py
2020-06-23 15:13:54 +03:00

20 lines
628 B
Python

import os
import buildozer
print("Changing global_buildozer_dir")
source = open(buildozer.__file__, "r", encoding="utf-8").read()
new_source = source.replace(
"""
@property
def global_buildozer_dir(self):
return join(expanduser('~'), '.buildozer')
""",
f"""
@property
def global_buildozer_dir(self):
return '{os.environ["GITHUB_WORKSPACE"]}/.buildozer_global'
""",
)
if new_source == source:
print("::warning::Cannot change global buildozer directory. Update buildozer-action to new version or create a Bug Request")
open(buildozer.__file__, "w", encoding="utf-8").write(new_source)