File size: 922 Bytes
5312808
7847b1d
5312808
63e1b1c
 
305b2db
 
 
 
63e1b1c
 
305b2db
 
 
 
63e1b1c
 
 
 
 
5312808
7847b1d
 
5312808
7847b1d
 
 
 
5312808
7847b1d
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import os
from flask import Flask, send_from_directory

# リポジトリのクローンを行う
def clone_repo():
    # クローンしたかどうかを判定するファイル
    clone_flag = "repo_cloned.flag"
    
    if not os.path.exists(clone_flag):
        print("Cloning the repository...")
        os.system("git clone https://github.com/ozh/cookieclicker.git .")
        
        # クローン完了後にフラグファイルを作成
        with open(clone_flag, 'w') as f:
            f.write("Repository has been cloned.")
    else:
        print("Repository already cloned.")

# クローンを実行
clone_repo()

# Flaskアプリケーションの設定
app = Flask(__name__)

# ルートでindex.htmlを表示
@app.route('/')
def index():
    return send_from_directory('.', 'index.html')

if __name__ == '__main__':
    # port 7860でFlaskアプリを起動
    app.run(host='0.0.0.0', port=7860)