mirror of
https://github.com/decompals/wibo.git
synced 2025-10-16 15:15:10 +00:00
Use WIBO_PATH, WINEPATH to resolve executables as well
This commit is contained in:
parent
ff04eb9f41
commit
086e08d93f
@ -292,10 +292,15 @@ static std::vector<std::filesystem::path> buildSearchDirectories() {
|
|||||||
dirs.push_back(wibo::guestExecutablePath.parent_path());
|
dirs.push_back(wibo::guestExecutablePath.parent_path());
|
||||||
}
|
}
|
||||||
dirs.push_back(std::filesystem::current_path());
|
dirs.push_back(std::filesystem::current_path());
|
||||||
if (const char *envPath = std::getenv("PATH")) {
|
const auto addFromEnv = [&](const char *envVar) {
|
||||||
auto parsed = parseHostPath(envPath);
|
if (const char *envPath = std::getenv(envVar)) {
|
||||||
dirs.insert(dirs.end(), parsed.begin(), parsed.end());
|
auto parsed = parseHostPath(envPath);
|
||||||
}
|
dirs.insert(dirs.end(), parsed.begin(), parsed.end());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
addFromEnv("WIBO_PATH");
|
||||||
|
addFromEnv("WINEPATH"); // Wine compatibility
|
||||||
|
addFromEnv("PATH");
|
||||||
return dirs;
|
return dirs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user