mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Modify examples directory search so that the directory can be found when the DemoRunner is in the JUCE root folder
This commit is contained in:
parent
9c54ccc99b
commit
ce810ff0b9
2 changed files with 8 additions and 2 deletions
|
|
@ -67,13 +67,15 @@ void JUCEDemos::registerDemo (std::function<Component*()> constructorCallback, c
|
|||
File JUCEDemos::findExamplesDirectoryFromExecutable (File exec)
|
||||
{
|
||||
int numTries = 15;
|
||||
auto exampleDir = exec.getParentDirectory().getChildFile ("examples");
|
||||
|
||||
if (exampleDir.exists())
|
||||
return exampleDir;
|
||||
|
||||
while (exec.getFileName() != "examples" && numTries-- > 0)
|
||||
exec = exec.getParentDirectory();
|
||||
|
||||
if (exec.getFileName() == "examples")
|
||||
return exec;
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue