From 7e3e3d07cbe9c4b5d23ad7b1674d51d0f7f4badb Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 24 Jun 2024 10:24:14 -0400 Subject: Add micromamba program to runtime PATH --- src/stasis_indexer.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/stasis_indexer.c b/src/stasis_indexer.c index 81aecf5..a7b0fce 100644 --- a/src/stasis_indexer.c +++ b/src/stasis_indexer.c @@ -518,6 +518,15 @@ void indexer_init_dirs(struct Delivery *ctx, const char *workdir) { path_store(&ctx->storage.results_dir, PATH_MAX, ctx->storage.output_dir, "results"); path_store(&ctx->storage.wheel_artifact_dir, PATH_MAX, ctx->storage.package_dir, "wheels"); path_store(&ctx->storage.conda_artifact_dir, PATH_MAX, ctx->storage.package_dir, "conda"); + + char newpath[PATH_MAX] = {0}; + if (getenv("PATH")) { + sprintf(newpath, "%s/bin:%s", ctx->storage.tools_dir, getenv("PATH")); + setenv("PATH", newpath, 1); + } else { + SYSERROR("%s", "environment variable PATH is undefined. Unable to continue."); + exit(1); + } } int main(int argc, char *argv[]) { -- cgit