sh and update

main
km0 2 years ago
parent a31ee3a2b9
commit 713fcb3ae3

@ -5,7 +5,6 @@ import markdown
from prefix import PrefixMiddleware from prefix import PrefixMiddleware
from dotenv import load_dotenv from dotenv import load_dotenv
from time import strftime, localtime from time import strftime, localtime
import random
import glob import glob
import subprocess import subprocess
@ -15,6 +14,7 @@ load_dotenv()
prefix = os.environ.get('URL_PREFIX', '') prefix = os.environ.get('URL_PREFIX', '')
port = os.environ.get('PORT', 3000) port = os.environ.get('PORT', 3000)
debug = os.environ.get('DEBUG', False) debug = os.environ.get('DEBUG', False)
update_script = os.environ.get('UPDATE', 'update.sh' )
# --- # ---
# Functions # Functions
@ -47,7 +47,7 @@ def txt_list():
return writings return writings
def render_list(): 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: with open('list.html', 'w+') as f:
f.write(render_template('home.html', writings=txt_list())) f.write(render_template('home.html', writings=txt_list()))

@ -1,4 +1,4 @@
cd /var/www/souptxt/ cd $1
rm -rf txt rm -rf txt
git clone https://git.xpub.nl/kamo/txt.git txt git clone https://git.xpub.nl/kamo/txt.git txt
cd txt cd txt

Loading…
Cancel
Save