Skip to content

Commit cfe187e

Browse files
committed
Fix: [ALAS] Deploy config wasn't redirected after Updater.delay()
1 parent d64d4b2 commit cfe187e

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

deploy/Windows/config.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,6 @@ def __init__(self, file=DEPLOY_CONFIG):
8080
self.config_template = {}
8181
self.read()
8282

83-
# Bypass webui.config.DeployConfig.__setattr__()
84-
# Don't write these into deploy.yaml
85-
super().__setattr__('GitOverCdn', self.Repository in ['cn'])
86-
if self.Repository in ['global', 'cn']:
87-
super().__setattr__('Repository', 'https://github.com/LmeSzinc/StarRailCopilot')
88-
8983
self.write()
9084
self.show_config()
9185

@@ -109,9 +103,21 @@ def read(self):
109103
if hasattr(self, key):
110104
super().__setattr__(key, value)
111105

106+
self.config_redirect()
107+
112108
def write(self):
113109
poor_yaml_write(self.config, self.file)
114110

111+
def config_redirect(self):
112+
"""
113+
Redirect deploy config, must be called after each `read()`
114+
"""
115+
# Bypass webui.config.DeployConfig.__setattr__()
116+
# Don't write these into deploy.yaml
117+
super().__setattr__('GitOverCdn', self.Repository in ['cn'])
118+
if self.Repository in ['global', 'cn']:
119+
super().__setattr__('Repository', 'https://github.com/LmeSzinc/StarRailCopilot')
120+
115121
def filepath(self, path):
116122
"""
117123
Args:

module/webui/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def read(self):
3838
if hasattr(self, key):
3939
super().__setattr__(key, value)
4040

41+
self.config_redirect()
42+
4143
def write(self):
4244
"""
4345
Write `self.config` into deploy config.

0 commit comments

Comments
 (0)