mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 00:52:16 -06:00
also consider TMPDIR and friends
This commit is contained in:
parent
ece08b8179
commit
0db1244d04
|
@ -29,12 +29,16 @@ def get_unixdir():
|
|||
paths = [
|
||||
(os.environ.get, "XDG_CONFIG_HOME"),
|
||||
(os.path.expanduser, "~/.config"),
|
||||
(os.environ.get, "TMPDIR"),
|
||||
(os.environ.get, "TEMP"),
|
||||
(os.environ.get, "TMP"),
|
||||
(unicode, "/tmp"),
|
||||
]
|
||||
for chk in [os.listdir, os.mkdir]:
|
||||
for pf, pa in paths:
|
||||
try:
|
||||
p = pf(pa)
|
||||
# print(chk.__name__, p, pa)
|
||||
if not p or p.startswith("~"):
|
||||
continue
|
||||
|
||||
|
|
Loading…
Reference in a new issue