import os | |
from flask import Flask, send_from_directory | |
# リポジトリのクローンを行う | |
def clone_repo(): | |
# 現在のディレクトリに`index.html`が存在しない場合のみクローンする | |
if not os.path.exists('index.html'): | |
print("Cloning the repository...") | |
os.system("git clone https://github.com/ozh/cookieclicker.git .") | |
else: | |
print("Repository already cloned.") | |
# クローンを実行 | |
clone_repo() | |
app = Flask(__name__) | |
# index.htmlをルートパスで表示 | |
def index(): | |
return send_from_directory('.', 'index.html') | |
if __name__ == '__main__': | |
app.run(debug=True) | |