From c93a11375eef409585fa072accec117d2c5c8458 Mon Sep 17 00:00:00 2001 From: kramo Date: Mon, 29 Dec 2025 01:02:04 +0100 Subject: [PATCH] game: Fix Game.save() --- cartridges/games.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cartridges/games.py b/cartridges/games.py index 3ce522a..ac8b06d 100644 --- a/cartridges/games.py +++ b/cartridges/games.py @@ -141,8 +141,8 @@ class Game(Gio.SimpleActionGroup): GAMES_DIR.mkdir(parents=True, exist_ok=True) path = (GAMES_DIR / self.game_id).with_suffix(".json") - with path.open(encoding="utf-8") as f: - json.dump(properties, f, indent=4) + with path.open("w", encoding="utf-8") as f: + json.dump(properties, f, indent=4, sort_keys=True) def _remove(self): self.removed = True