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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -47,12 +47,18 @@ def clone_or_update_repo():
47
  logging.error(result.stderr)
48
 
49
  if os.path.exists(TARGET_FILE):
50
- logging.info("startup.js を修正中...")
51
  with open(TARGET_FILE, "r", encoding="utf-8") as f:
52
  content = f.read()
53
- new_content = content.replace("https://studio.penguinmod.com", "*")
54
- with open(TARGET_FILE, "w", encoding="utf-8") as f:
55
- f.write(new_content)
 
 
 
 
 
 
 
56
 
57
  logging.info("テンプレートと静的ファイルをコピー中...")
58
  os.makedirs("templates", exist_ok=True)
 
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
+ '}, "*");'
55
+ )
56
+ if content == new_content:
57
+ logging.warning("置換対象の文字列が見つかりませんでした。")
58
+ else:
59
+ with open(TARGET_FILE, "w", encoding="utf-8") as f:
60
+ f.write(new_content)
61
+ logging.info("置換が完了しました。")
62
 
63
  logging.info("テンプレートと静的ファイルをコピー中...")
64
  os.makedirs("templates", exist_ok=True)