diff options
author | Joseph Hunkeler <jhunkeler@users.noreply.github.com> | 2024-11-14 00:36:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-14 00:36:06 -0500 |
commit | 613bfff7ffae94b76c9d3bd46b50b42ea4ceb164 (patch) | |
tree | 7adbd4a95963d61b02c652a27de855a0d538a9bd /include | |
parent | 52e6d0f495023c0aa939bf6b2170ca5ea853202b (diff) | |
parent | 836cc753ea22fd8a3d152f2b00dae971ee3dc943 (diff) | |
download | stasis-613bfff7ffae94b76c9d3bd46b50b42ea4ceb164.tar.gz |
Merge pull request #69 from jhunkeler/workaround-shebang-nightmare
Workaround for shebang nightmare
Diffstat (limited to 'include')
-rw-r--r-- | include/conda.h | 2 | ||||
-rw-r--r-- | include/utils.h | 16 |
2 files changed, 18 insertions, 0 deletions
diff --git a/include/conda.h b/include/conda.h index f031479..b8d0caa 100644 --- a/include/conda.h +++ b/include/conda.h @@ -229,4 +229,6 @@ const char *pkg_index_provides_strerror(int code); char *conda_get_active_environment(); +int conda_env_exists(const char *root, const char *name); + #endif //STASIS_CONDA_H diff --git a/include/utils.h b/include/utils.h index 4ade817..e26b3c5 100644 --- a/include/utils.h +++ b/include/utils.h @@ -392,4 +392,20 @@ int mkdirs(const char *_path, mode_t mode); */ char *find_version_spec(char *package_name); +// mode flags for env_manipulate_pathstr +#define PM_APPEND 1 << 0 +#define PM_PREPEND 1 << 1 +#define PM_ONCE 1 << 2 + +/** +* Add paths to the head or tail of an environment variable. +* +* @param key environment variable to manipulate +* @param path to insert (does not need to exist) +* @param mode PM_APPEND `$path:$PATH` +* @param mode PM_PREPEND `$PATH:path` +* @param mode PM_ONCE do not manipulate if `path` is present in PATH variable +*/ +int env_manipulate_pathstr(const char *key, char *path, int mode); + #endif //STASIS_UTILS_H |