Spaces:
Running
Running
Update app.py
Browse files
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(
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|