Skip to content

Commit

Permalink
fix: path issue
Browse files Browse the repository at this point in the history
hiddify-com committed Oct 15, 2023
1 parent cd348fb commit 9afc84c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions common/jinja.py
Original file line number Diff line number Diff line change
@@ -16,10 +16,11 @@ def exec(command):
print(e.output)
return ""


def render_j2_templates(start_path):
# Set up the Jinja2 environment
env = Environment(loader=FileSystemLoader('/'))

for root, dirs, files in os.walk(start_path):
for file in files:
if file.endswith('.j2'):
@@ -41,11 +42,11 @@ def render_j2_templates(start_path):
except Exception as e:
print(f"Error parsing json: {e}")

with open(output_file_path, 'w',encoding='utf-8') as output_file:
with open(output_file_path, 'w', encoding='utf-8') as output_file:
output_file.write(rendered_content)

# print(f'Rendered and stored: {output_file_path}')


start_path = '/Users/me/Hiddify-Server/other/telegram/tgo/'
start_path = '/opt/hiddify-server/'
render_j2_templates(start_path)

0 comments on commit 9afc84c

Please sign in to comment.