Skip to content

Commit

Permalink
CatgirlDownloader: create config in appropriate subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
42LoCo42 committed Nov 5, 2024
1 parent 841649f commit 408c41c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/CatgirlDownloader/configdir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/src/preferences.py b/src/preferences.py
index 0cdaa82e6b..c89c1112db 100644
--- a/src/preferences.py
+++ b/src/preferences.py
@@ -8,7 +8,8 @@
"nsfw": False,
}
self.directory = GLib.get_user_config_dir()
- self.file = os.path.join(self.directory, "config.json")
+ self.file = os.path.join(self.directory, "catgirldownloader/config.json")
+ os.makedirs(os.path.dirname(self.file), exist_ok = True)
if not os.path.exists(self.file):
f = open(self.file, "w+")
f.write(json.dumps(self.preferences))
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pkgs: pkgs.stdenv.mkDerivation rec {
rev = version;
hash = "sha256-u5Rea2JkeLA5AOys9JfvLi6mfKbElbfZWdWVErUl1BU=";
};
patches = [ ./configdir.patch ];

nativeBuildInputs = with pkgs; [
desktop-file-utils
Expand Down

0 comments on commit 408c41c

Please sign in to comment.