mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-29 02:40:05 +00:00
Workaround to avoid an assertion when using File::invokedExecutableFile from a command-line invoked app on OSX
This commit is contained in:
parent
59cc979cfe
commit
8f7d9f7522
2 changed files with 8 additions and 10 deletions
|
|
@ -218,7 +218,7 @@ File File::getSpecialLocation (const SpecialLocationType type)
|
|||
|
||||
case invokedExecutableFile:
|
||||
if (juce_argv != nullptr && juce_argc > 0)
|
||||
return File (CharPointer_UTF8 (juce_argv[0]));
|
||||
return File::getCurrentWorkingDirectory().getChildFile (CharPointer_UTF8 (juce_argv[0]));
|
||||
// deliberate fall-through...
|
||||
|
||||
case currentExecutableFile:
|
||||
|
|
@ -229,13 +229,13 @@ File File::getSpecialLocation (const SpecialLocationType type)
|
|||
const File exe (juce_getExecutableFile());
|
||||
const File parent (exe.getParentDirectory());
|
||||
|
||||
#if JUCE_IOS
|
||||
#if JUCE_IOS
|
||||
return parent;
|
||||
#else
|
||||
#else
|
||||
return parent.getFullPathName().endsWithIgnoreCase ("Contents/MacOS")
|
||||
? parent.getParentDirectory().getParentDirectory()
|
||||
: exe;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
case hostApplicationPath:
|
||||
|
|
|
|||
|
|
@ -198,11 +198,9 @@ bool SystemStats::isRunningInAppExtensionSandbox() noexcept
|
|||
bundle = bundle.getParentDirectory().getParentDirectory();
|
||||
#endif
|
||||
|
||||
if (! bundle.isDirectory())
|
||||
return false;
|
||||
|
||||
return (bundle.getFileExtension() == ".appex");
|
||||
#else
|
||||
return false;
|
||||
if (bundle.isDirectory())
|
||||
return (bundle.getFileExtension() == ".appex");
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue