mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Simplify setting Dockerfile defaults
This commit is contained in:
parent
00a237c144
commit
9f34f049ec
1 changed files with 5 additions and 2 deletions
|
@ -3,10 +3,13 @@ from os import environ
|
|||
from os.path import dirname
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
def checkEnv(envName, defaultValue):
|
||||
return bool(len(environ[envName])) if envName in environ else defaultValue
|
||||
|
||||
def main():
|
||||
print(Environment(loader=FileSystemLoader(dirname(__file__))).get_template("Dockerfile").render(
|
||||
DEBUG=bool(len(environ["DEBUG"])) if "DEBUG" in environ else True,
|
||||
LTO=bool(len(environ["LTO"])) if "LTO" in environ else True,
|
||||
DEBUG=checkEnv("DEBUG", True),
|
||||
LTO=checkEnv("LTO", True),
|
||||
))
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Add table
Reference in a new issue