soiz commited on
Commit
63e1b1c
·
verified ·
1 Parent(s): 46fdb99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -1,9 +1,17 @@
1
  import os
2
  from flask import Flask, send_from_directory
3
 
4
- # クローン先のディレクトリにすでに必要なファイルがあるかをチェック
5
- if not os.path.exists('index.html'):
6
- os.system("git clone https://github.com/ozh/cookieclicker.git .")
 
 
 
 
 
 
 
 
7
 
8
  app = Flask(__name__)
9
 
@@ -13,4 +21,4 @@ def index():
13
  return send_from_directory('.', 'index.html')
14
 
15
  if __name__ == '__main__':
16
- app.run(debug=True, port=7860)
 
1
  import os
2
  from flask import Flask, send_from_directory
3
 
4
+ # リポジトリのクローンを行う
5
+ def clone_repo():
6
+ # 現在のディレクトリに`index.html`が存在しない場合のみクローンする
7
+ if not os.path.exists('index.html'):
8
+ print("Cloning the repository...")
9
+ os.system("git clone https://github.com/ozh/cookieclicker.git .")
10
+ else:
11
+ print("Repository already cloned.")
12
+
13
+ # クローンを実行
14
+ clone_repo()
15
 
16
  app = Flask(__name__)
17
 
 
21
  return send_from_directory('.', 'index.html')
22
 
23
  if __name__ == '__main__':
24
+ app.run(debug=True)