Procházet zdrojové kódy

Merge pull request #7 from ajgrf/fix-bw-data-file-path

bitwarden: fix bw data file locations
Sean Farley před 4 roky
rodič
revize
6ddc40591e
1 změnil soubory, kde provedl 12 přidání a 7 odebrání
  1. 12 7
      bitwarden.el

+ 12 - 7
bitwarden.el

@@ -50,13 +50,18 @@
   :type 'string)
 
 (defcustom bitwarden-data-file
-  (expand-file-name (cond
-		     ((eq system-type 'darwin)
-		      "~/Library/Application Support/Bitwarden CLI/data.json")
-		     ((eq system-type 'windows-nt)
-		      "~/AppData/Bitwarden CLI/data.json")
-		     (t
-		      "~/.config/Bitwarden CLI/data.json")))
+  (expand-file-name "Bitwarden CLI/data.json"
+                    (cond
+                     ((getenv "BITWARDENCLI_APPDATA_DIR")
+                      (getenv "BITWARDENCLI_APPDATA_DIR"))
+                     ((eq system-type 'darwin)
+                      "~/Library/Application Support")
+                     ((eq system-type 'windows-nt)
+                      (getenv "APPDATA"))
+                     ((getenv "XDG_CONFIG_HOME")
+                      (getenv "XDG_CONFIG_HOME"))
+                     (t
+                      "~/.config")))
   "The bw data file used by Bitwarden."
   :group 'bitwarden
   :type 'string)