Update app.py
Browse files
app.py
CHANGED
@@ -17,14 +17,16 @@ def clone_repo():
|
|
17 |
if result != 0:
|
18 |
print("Error: Failed to clone the repository.")
|
19 |
else:
|
20 |
-
# index.html
|
21 |
index_html_path = os.path.join(temp_dir, 'index.html')
|
22 |
if os.path.exists(index_html_path):
|
23 |
-
|
|
|
|
|
24 |
|
25 |
# index.htmlをカレントディレクトリに移動
|
26 |
-
shutil.move(
|
27 |
-
|
28 |
# 静的ファイルをstaticディレクトリに移動
|
29 |
if not os.path.exists('static'):
|
30 |
os.mkdir('static')
|
|
|
17 |
if result != 0:
|
18 |
print("Error: Failed to clone the repository.")
|
19 |
else:
|
20 |
+
# index.htmlを削除(存在する場合)
|
21 |
index_html_path = os.path.join(temp_dir, 'index.html')
|
22 |
if os.path.exists(index_html_path):
|
23 |
+
# もしカレントディレクトリに既にindex.htmlが存在する場合は削除
|
24 |
+
if os.path.exists('index.html'):
|
25 |
+
os.remove('index.html')
|
26 |
|
27 |
# index.htmlをカレントディレクトリに移動
|
28 |
+
shutil.move(index_html_path, '.')
|
29 |
+
|
30 |
# 静的ファイルをstaticディレクトリに移動
|
31 |
if not os.path.exists('static'):
|
32 |
os.mkdir('static')
|