mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-11-09 23:00:56 +00:00
44d6f237d5
fixes #1037
29 lines
600 B
Python
29 lines
600 B
Python
import os
|
|
import re
|
|
|
|
|
|
def get_erpnext_version():
|
|
erpnext_version = os.getenv("ERPNEXT_VERSION")
|
|
assert erpnext_version, "No ERPNext version set"
|
|
return erpnext_version
|
|
|
|
|
|
def update_env(erpnext_version: str):
|
|
with open("example.env", "r+") as f:
|
|
content = f.read()
|
|
content = re.sub(
|
|
rf"ERPNEXT_VERSION=.*", f"ERPNEXT_VERSION={erpnext_version}", content
|
|
)
|
|
f.seek(0)
|
|
f.truncate()
|
|
f.write(content)
|
|
|
|
|
|
def main() -> int:
|
|
update_env(get_erpnext_version())
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|