From b0bd91d08961806b0c00e23397e02c7b203ca0d2 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sun, 12 May 2024 18:01:13 +0200 Subject: [PATCH] tell me you're a js dev without telling me you're a js dev --- deploy.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/deploy.py b/deploy.py index 3ac3cb0..cd5f8b7 100644 --- a/deploy.py +++ b/deploy.py @@ -1,7 +1,7 @@ from ftplib import FTP import requests import minify_html -from os import listdir, getenv +from os import listdir, getenv, chdir from io import BytesIO # init ftp @@ -10,7 +10,9 @@ print(getenv('FTP_SERVER')) ftp = FTP(getenv('FTP_SERVER')) ftp.login(getenv('FTP_USER'), getenv('FTP_PASSWORD')) -for f in [i for i in listdir('html') if i.endswith('.html')]: +chdir('html') + +for f in [i for i in listdir() if i.endswith('.html')]: # 1. Minify the index.html file using minify-html minified_content = minify_html.minify(open(f, 'r').read(), minify_css=True, minify_css_level_3=True, do_not_minify_doctype=True)