Skip to content

Commit b0d2e08

Browse files
committed
Fix external plugins directory missing on MacOS
1 parent 9daaa93 commit b0d2e08

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

Source/Processors/PluginManager/PluginManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void PluginManager::loadAllPlugins()
8989

9090
#ifdef __APPLE__
9191
paths.add(File::getSpecialLocation(File::currentApplicationFile).getChildFile("Contents/PlugIns"));
92-
paths.add(File::getSpecialLocation(File::userApplicationDataDirectory).getChildFile("Application Support/open-ephys/PlugIns"));
92+
paths.add(File::getSpecialLocation(File::userApplicationDataDirectory).getChildFile("Application Support/open-ephys/plugins"));
9393
#else
9494
paths.add(File::getSpecialLocation(File::currentApplicationFile).getParentDirectory().getChildFile("plugins"));
9595
#endif

Source/UI/PluginInstaller.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ void PluginInstaller::closeButtonPressed()
102102

103103
void PluginInstaller::createXmlFile()
104104
{
105-
String xmlFile = "plugins" + File::separatorString + "installedPlugins.xml";
105+
File pluginsDir = getPluginsLocationDirectory().getChildFile("plugins");
106+
if (!pluginsDir.isDirectory())
107+
pluginsDir.createDirectory();
108+
109+
String xmlFile = "plugins" + File::separatorString + "installedPlugins.xml";
106110
File file = getPluginsLocationDirectory().getChildFile(xmlFile);
107111

108112
XmlDocument doc(file);
@@ -130,7 +134,7 @@ void PluginInstaller::createXmlFile()
130134
forEachXmlChildElement(*child, e)
131135
{
132136
File pluginPath = getPluginsLocationDirectory().getChildFile(baseStr + e->getAttributeValue(1));
133-
if (!pluginPath.existsAsFile())
137+
if (!pluginPath.exists())
134138
elementsToRemove.add(e);
135139
}
136140

0 commit comments

Comments
 (0)