change: suppress missing shortcuts message

This commit is contained in:
aclist committed 2026-10-26 17:19:56 +09:00
1 parent 100cb43afc
commit 5fb10d9758
1 file changed
+6 -5
+6 -5
View File
@@ -173,11 +173,12 @@ class Shortcuts:
self.save_shortcuts()
def save_shortcuts(self) -> None:
try:
backup = self.shortcuts_path.with_suffix(".vdf.bak")
shutil.copy(self.shortcuts_path, backup)
except Exception as e:
logger.critical(e)
if self.shortcuts_path.is_file():
try:
backup = self.shortcuts_path.with_suffix(".vdf.bak")
shutil.copy(self.shortcuts_path, backup)
except Exception as e:
logger.critical(e)
try:
with open(self.shortcuts_path, "wb") as f:
vdf.binary_dump(self.shortcuts, f)