mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
[Input] Search active conda environment for YAML files
This commit is contained in:
parent
54ede24657
commit
d564130fc5
@ -224,12 +224,14 @@ void Application::setDefaultDirectories()
|
||||
// environment variable).
|
||||
#ifdef _WIN32
|
||||
string pathsep = ";";
|
||||
string dirsep = "\\";
|
||||
#else
|
||||
string pathsep = ":";
|
||||
string dirsep = "/";
|
||||
#endif
|
||||
|
||||
if (getenv("CANTERA_DATA") != 0) {
|
||||
string s = string(getenv("CANTERA_DATA"));
|
||||
if (getenv("CANTERA_DATA") != nullptr) {
|
||||
string s(getenv("CANTERA_DATA"));
|
||||
size_t start = 0;
|
||||
size_t end = s.find(pathsep);
|
||||
while (end != npos) {
|
||||
@ -240,6 +242,13 @@ void Application::setDefaultDirectories()
|
||||
inputDirs.push_back(s.substr(start,end));
|
||||
}
|
||||
|
||||
// If a conda environment is active, add the location of the Cantera data directory
|
||||
// that may exist in that environment.
|
||||
if (getenv("CONDA_PREFIX") != nullptr) {
|
||||
string s(getenv("CONDA_PREFIX"));
|
||||
inputDirs.push_back(s + dirsep + "share" + dirsep + "cantera" + dirsep + "data");
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
// Under Windows, the Cantera setup utility records the installation
|
||||
// directory in the registry. Data files are stored in the 'data'
|
||||
|
Loading…
Reference in New Issue
Block a user