Skip to content

Commit a3538a2

Browse files
committed
Use Path and set env var if not set
1 parent 527ad6b commit a3538a2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

autoafids/run.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626
)
2727

2828
# Set the conda prefix directory
29-
conda_prefix = str(utils.get_download_dir()) + "/" + "conda"
29+
conda_prefix = Path(utils.get_download_dir()) / "conda"
3030

31-
# Set the environment variable SNAKEMAKE_CONDA_PREFIX
32-
os.environ["SNAKEMAKE_CONDA_PREFIX"] = str(conda_prefix)
31+
# Set the environment variable SNAKEMAKE_CONDA_PREFIX if not already set
32+
if not "SNAKEMAKE_CONDA_PREFIX" in os.environ:
33+
os.environ["SNAKEMAKE_CONDA_PREFIX"] = str(Path(utils.get_download_dir()) / "conda")
3334

3435
def get_parser():
3536
"""Exposes parser for sphinx doc generation, cwd is the docs dir"""

0 commit comments

Comments
 (0)