Skip to content

Commit

Permalink
Handle empty case
Browse files Browse the repository at this point in the history
  • Loading branch information
jkong-anaconda committed Apr 11, 2024
1 parent d26a04d commit 38aec97
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/conda_project/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,11 @@ def init(
@property
def environments(self) -> BaseEnvironments:
env_path = self.directory / "envs"
env_paths = os.environ.get("CONDA_PROJECT_ENVS_PATH", "").split(os.pathsep)
specified_path = os.environ.get("CONDA_PROJECT_ENVS_PATH", "")
env_paths = specified_path.split(os.pathsep) if specified_path else []

for path in env_paths:
if os.access(path, os.W_OK) or not os.path.exists(path):
if path and (os.access(path, os.W_OK) or not os.path.exists(path)):
env_path = Path(os.path.join(self.directory, path))
break

Expand Down Expand Up @@ -805,6 +806,7 @@ def clean(
) -> None:
"""Remove the conda environment."""

breakpoint()
_ = call_conda(
["env", "remove", "-p", str(self.prefix)],
condarc_path=self.project.condarc,
Expand Down

0 comments on commit 38aec97

Please sign in to comment.