diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-11-13 12:13:34 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-11-13 12:13:34 -0500 |
commit | 836cc753ea22fd8a3d152f2b00dae971ee3dc943 (patch) | |
tree | 7adbd4a95963d61b02c652a27de855a0d538a9bd /src/lib | |
parent | 35471289b619994c4f04fd2b6cb6d04a16cb1b33 (diff) | |
download | stasis-836cc753ea22fd8a3d152f2b00dae971ee3dc943.tar.gz |
Attempt conda environment removal only when its present on-diskworkaround-shebang-nightmare
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/core/conda.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/core/conda.c b/src/lib/core/conda.c index c98be1c..b2caa63f 100644 --- a/src/lib/core/conda.c +++ b/src/lib/core/conda.c @@ -542,3 +542,9 @@ int conda_index(const char *path) { sprintf(command, "index %s", path); return conda_exec(command); } + +int conda_env_exists(const char *root, const char *name) { + char path[PATH_MAX] = {0}; + snprintf(path, sizeof(path) - 1 - 6, "%s/envs/%s", root, name); + return access(path, F_OK) == 0; +} |