Skip to content

Commit 6c452c7

Browse files
authored
BUG: fix cache identification on read-only systems. (#367)
1 parent 97e80cc commit 6c452c7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

q2cli/util.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ class OutOfDisk(Exception):
1414
def get_app_dir():
1515
import os
1616
conda_prefix = os.environ.get('CONDA_PREFIX')
17-
if conda_prefix is not None and os.access(conda_prefix, os.W_OK | os.X_OK):
18-
return os.path.join(conda_prefix, 'var', 'q2cli')
17+
environment_cache = os.path.join(conda_prefix, 'var', 'q2cli')
18+
if conda_prefix is not None and (os.access(conda_prefix, os.W_OK | os.X_OK)
19+
or os.path.exists(environment_cache)):
20+
return environment_cache
1921
else:
2022
import click
2123
return click.get_app_dir('q2cli', roaming=False)

0 commit comments

Comments
 (0)