aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@users.noreply.github.com>2025-03-31 15:53:52 -0400
committerGitHub <noreply@github.com>2025-03-31 15:53:52 -0400
commit34cee3ad5258b86dfe60df155636bf929b9d0e13 (patch)
tree5c11f2fbdc713ed49b65ce839e0550023ff5f0b2 /src/lib
parent5da81c51855b99bc8118d15dce7b8063af8a9afe (diff)
parente817b38090defab01e64bc3516ea474215bfcb09 (diff)
downloadstasis-34cee3ad5258b86dfe60df155636bf929b9d0e13.tar.gz
Merge pull request #102 from jhunkeler/order-of-battle
Bugs and fixes
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/core/conda.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/core/conda.c b/src/lib/core/conda.c
index 80d280a..9b5c77c 100644
--- a/src/lib/core/conda.c
+++ b/src/lib/core/conda.c
@@ -500,7 +500,18 @@ int conda_setup_headless() {
int conda_env_create_from_uri(char *name, char *uri) {
char env_command[PATH_MAX];
- sprintf(env_command, "env create -n %s -f %s", name, uri);
+ char *uri_fs = NULL;
+
+ // Convert a bare system path to a file:// path
+ if (!strstr(uri, "://")) {
+ uri_fs = calloc(strlen(uri) + strlen("file://") + 1, sizeof(*uri_fs));
+ if (!uri_fs) {
+ return -1;
+ }
+ snprintf(uri_fs, strlen(uri) + strlen("file://") + 1, "%s%s", "file://", uri);
+ }
+ sprintf(env_command, "env create -n '%s' --file='%s'", name, uri_fs ? uri_fs : uri);
+ guard_free(uri_fs);
return conda_exec(env_command);
}