allow force pulls

This commit is contained in:
Strix 2023-10-14 22:38:06 +02:00
parent a8808b4a27
commit ab17f173d3
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774

View file

@ -11,7 +11,7 @@ class handler(BaseHTTPRequestHandler):
self.send_response(200) self.send_response(200)
self.send_header('Content-type','text/plain') self.send_header('Content-type','text/plain')
self.end_headers() self.end_headers()
if (time.time() - os.path.getmtime('./lib/deploy.sh') > 86400): if (time.time() - os.path.getmtime('./lib/deploy.sh') > 86400) or self.path == '/pull':
subprocess.call(['git', 'pull']) subprocess.call(['git', 'pull'])
with open('./lib/deploy.sh') as f: with open('./lib/deploy.sh') as f:
self.wfile.write(bytes(f.read(), 'utf-8')) self.wfile.write(bytes(f.read(), 'utf-8'))