Skip to content

Commit 44ecb4f

Browse files
committed
fixed update error
1 parent 91b5cc3 commit 44ecb4f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,8 +786,9 @@ def set_current_language(lang: str) -> None:
786786

787787

788788
def _t(key: str, **kwargs) -> str:
789+
# 防御:若打包的旧版本缺失 I18N,避免 NameError
789790
lang = _current_language
790-
table = I18N.get(key, {})
791+
table = globals().get('I18N', {}).get(key, {})
791792
text = table.get(lang) or table.get(LANG_ZH_CN) or key
792793
try:
793794
return text.format(**kwargs)
@@ -1557,7 +1558,8 @@ def _run(cmd: list) -> Tuple[int, str, str]:
15571558
rm -rf \"$TARGET_APP\"
15581559
ditto \"$NEW_APP\" \"$TARGET_APP\"
15591560
/usr/bin/xattr -dr com.apple.quarantine \"$TARGET_APP\" || true
1560-
open \"$TARGET_APP\"
1561+
chmod +x "$TARGET_APP/Contents/MacOS/*" || true
1562+
open "$TARGET_APP"
15611563
"""
15621564
with open(script_path, "w", encoding="utf-8") as f:
15631565
f.write(script)

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ pyobjc-core==10.3.1
22
pyobjc-framework-Cocoa==10.3.1
33
rumps==0.4.0
44
requests>=2.31.0
5+
charset-normalizer>=3.0.0

0 commit comments

Comments
 (0)