diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-06-16 11:39:00 -0400 |
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2026-06-22 11:57:05 -0400 |
| commit | 9863a96a91b853d70cc1972db1c36df65c6cfecf (patch) | |
| tree | 3f2835b9c29476c1248c6a455b79fb9c1333f2bc /src/lib | |
| parent | 4798135aec35ef84baa43dcc38a3681e490c6c78 (diff) | |
| download | stasis-9863a96a91b853d70cc1972db1c36df65c6cfecf.tar.gz | |
Ensure .condrc exists and conda knows where to find it
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/core/conda.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/core/conda.c b/src/lib/core/conda.c index b1d4cc2..8d2753d 100644 --- a/src/lib/core/conda.c +++ b/src/lib/core/conda.c @@ -585,6 +585,19 @@ int conda_check_required() { } int conda_setup_headless(struct CondaCapabilities *cc) { + mkdirs(cc->prefix, 0755); + + char rcpath[PATH_MAX]; + snprintf(rcpath, sizeof(rcpath), "%s/.condarc", cc->prefix); + touch(rcpath); + if (errno == ENOENT) { + errno = 0; + } + + setenv("CONDARC", rcpath, 1); + setenv("MAMBARC", rcpath, 1); + setenv("MAMBA_ROOT_PREFIX", cc->prefix, 1); + if (globals.verbose) { conda_exec("config --system --set quiet false"); } else { |
