From ab1e28b69018a7132cab69198686282929d274f5 Mon Sep 17 00:00:00 2001 From: falkTX Date: Thu, 11 May 2023 04:29:32 +0200 Subject: [PATCH] Allow usage of CARLA_DISCOVERY_PATH env var for cached types Signed-off-by: falkTX --- source/discovery/carla-discovery.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/source/discovery/carla-discovery.cpp b/source/discovery/carla-discovery.cpp index c7169f2e4..476c0d509 100644 --- a/source/discovery/carla-discovery.cpp +++ b/source/discovery/carla-discovery.cpp @@ -180,19 +180,22 @@ static void print_cached_plugin(const CarlaCachedPluginInfo* const pinfo) static void do_cached_check(const PluginType type) { - const char* plugPath; + const char* plugPath = std::getenv("CARLA_DISCOVERY_PATH"); - switch (type) + if (plugPath == nullptr) { - case PLUGIN_LV2: - plugPath = std::getenv("LV2_PATH"); - break; - case PLUGIN_SFZ: - plugPath = std::getenv("SFZ_PATH"); - break; - default: - plugPath = nullptr; - break; + switch (type) + { + case PLUGIN_LV2: + plugPath = std::getenv("LV2_PATH"); + break; + case PLUGIN_SFZ: + plugPath = std::getenv("SFZ_PATH"); + break; + default: + plugPath = nullptr; + break; + } } # ifdef USING_JUCE