From 713fcb3ae3c1ff009434f0f3760e95613cbcf38b Mon Sep 17 00:00:00 2001 From: Francesco Luzzana Date: Sun, 4 Dec 2022 00:03:56 +0100 Subject: [PATCH] sh and update --- souptxt.py | 4 ++-- update.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/souptxt.py b/souptxt.py index ad8f990..59069dc 100644 --- a/souptxt.py +++ b/souptxt.py @@ -5,7 +5,6 @@ import markdown from prefix import PrefixMiddleware from dotenv import load_dotenv from time import strftime, localtime -import random import glob import subprocess @@ -15,6 +14,7 @@ load_dotenv() prefix = os.environ.get('URL_PREFIX', '') port = os.environ.get('PORT', 3000) debug = os.environ.get('DEBUG', False) +update_script = os.environ.get('UPDATE', 'update.sh' ) # --- # Functions @@ -47,7 +47,7 @@ def txt_list(): return writings def render_list(): - subprocess.run(['sh', '/var/www/souptxt/update.sh'], shell=True) + subprocess.run(['sh', update_script], shell=True) with open('list.html', 'w+') as f: f.write(render_template('home.html', writings=txt_list())) diff --git a/update.sh b/update.sh index 63bcf9a..654ed91 100644 --- a/update.sh +++ b/update.sh @@ -1,4 +1,4 @@ -cd /var/www/souptxt/ +cd $1 rm -rf txt git clone https://git.xpub.nl/kamo/txt.git txt cd txt