mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-09 22:02:10 +02:00
Respect $XDG_DATA_HOME when looking for binaries
Since we're using the XDG base dir package in yabridgectl we were already doing this there, so it makes sense to also do this in yabridge itself even though it's very unlikely the user will have this set.
This commit is contained in:
@@ -373,8 +373,12 @@ std::vector<boost::filesystem::path> get_augmented_search_path() {
|
||||
boost::this_process::path();
|
||||
|
||||
const bp::environment environment = boost::this_process::environment();
|
||||
if (auto home_directory = environment.find("HOME");
|
||||
home_directory != environment.end()) {
|
||||
if (auto xdg_data_home = environment.find("XDG_DATA_HOME");
|
||||
xdg_data_home != environment.end()) {
|
||||
search_path.push_back(fs::path(xdg_data_home->to_string()) /
|
||||
"yabridge");
|
||||
} else if (auto home_directory = environment.find("HOME");
|
||||
home_directory != environment.end()) {
|
||||
search_path.push_back(fs::path(home_directory->to_string()) / ".local" /
|
||||
"share" / "yabridge");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user