soiz1 commited on
Commit
a61fcdb
·
verified ·
1 Parent(s): 63b83fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -46,9 +46,14 @@ def clone_or_update_repo():
46
  if result.stderr:
47
  logging.error(result.stderr)
48
 
49
- if os.path.exists(TARGET_FILE):
 
 
50
  with open(TARGET_FILE, "r", encoding="utf-8") as f:
51
  content = f.read()
 
 
 
52
  new_content = content.replace(
53
  '}, "https://studio.penguinmod.com");',
54
  '}, "*");'
@@ -72,6 +77,7 @@ def clone_or_update_repo():
72
 
73
  logging.info("リポジトリの更新が完了しました。")
74
 
 
75
  # スケジューラを実行する関数(1分ごと)
76
  def run_scheduler():
77
  schedule.every(60).minutes.do(clone_or_update_repo)
 
46
  if result.stderr:
47
  logging.error(result.stderr)
48
 
49
+ if not os.path.exists(TARGET_FILE):
50
+ logging.warning(f"{TARGET_FILE} が存在しません。")
51
+ else:
52
  with open(TARGET_FILE, "r", encoding="utf-8") as f:
53
  content = f.read()
54
+ logging.info(f"pull直後のstartup.jsの内容抜粋:\n{content[:200]}") # 先頭200文字をログ出力
55
+
56
+ logging.info("startup.js を修正中...")
57
  new_content = content.replace(
58
  '}, "https://studio.penguinmod.com");',
59
  '}, "*");'
 
77
 
78
  logging.info("リポジトリの更新が完了しました。")
79
 
80
+
81
  # スケジューラを実行する関数(1分ごと)
82
  def run_scheduler():
83
  schedule.every(60).minutes.do(clone_or_update_repo)