You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
664 B
Python

import os
from shutil import rmtree
from flask import Blueprint, render_template, request, url_for
from . import git
repo_url = os.environ.get("REPO_URL")
repo_path = os.environ.get("REPO_PATH")
bp = Blueprint("contents", __name__, url_prefix="/contents")
@bp.route("/", method=("GET", "POST"))
def contents():
if request.method == "POST":
print(request)
if request.form.get("secret") == os.environ.get("REPO_SECRET"):
print("Updating the contents!")
print("Cleaning the folder")
rmtree(repo_path)
print("Cloning the repo")
git.clone_repo(repo_url, repo_path)
return "Hello"