depot/third_party/nixpkgs/pkgs/by-name/yt/ytdownloader/config-dir.patch
Default email 587713944a Project import generated by Copybara.
GitOrigin-RevId: 6143fc5eeb9c4f00163267708e26191d1e918932
2024-04-21 17:54:59 +02:00

18 lines
506 B
Diff

--- a/main.js
+++ b/main.js
@@ -13,6 +13,15 @@
const fs = require("fs");
const path = require("path");
autoUpdater.autoDownload = false;
+
+// Set the config directory to XDG_CONFIG_HOME/ytdownloader
+const xdgConfigHome = process.env.XDG_CONFIG_HOME;
+let configDir = app.getPath('home') + "/.config/ytdownloader";
+if (xdgConfigHome) {
+ configDir = xdgConfigHome + "/ytdownloader";
+}
+app.setPath ('userData', configDir);
+
/**@type {BrowserWindow} */
let win = null;
let secondaryWindow = null;