We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent acfaacb commit b17ccc3Copy full SHA for b17ccc3
copyparty/__main__.py
@@ -228,7 +228,21 @@ def get_unixdir() -> str:
228
if E.mod.endswith("__init__"):
229
E.mod = os.path.dirname(E.mod)
230
231
- if sys.platform == "win32":
+ try:
232
+ p = os.environ.get("XDG_CONFIG_HOME")
233
+ if not p:
234
+ raise Exception()
235
+ p = os.path.abspath(os.path.realpath(p))
236
+ p = os.path.join(p, "copyparty")
237
+ if not os.path.isdir(p):
238
+ os.mkdir(p)
239
+ os.listdir(p)
240
+ except:
241
+ p = ""
242
+
243
+ if p:
244
+ E.cfg = p
245
+ elif sys.platform == "win32":
246
bdir = os.environ.get("APPDATA") or os.environ.get("TEMP") or "."
247
E.cfg = os.path.normpath(bdir + "/copyparty")
248
elif sys.platform == "darwin":
0 commit comments