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)