soiz commited on
Commit
427bc20
·
verified ·
1 Parent(s): 4cf1b21

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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
- os.remove(index_html_path)
 
 
24
 
25
  # index.htmlをカレントディレクトリに移動
26
- shutil.move(os.path.join(temp_dir, 'index.html'), '.')
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')