Skip to content

Commit

Permalink
Workaround to avoid an assertion when using File::invokedExecutableFi…
Browse files Browse the repository at this point in the history
…le from a command-line invoked app on OSX
  • Loading branch information
julianstorer committed Aug 11, 2016
1 parent 59cc979 commit 8f7d9f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
8 changes: 4 additions & 4 deletions modules/juce_core/native/juce_mac_Files.mm
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static bool launchExecutable (const String& pathAndArguments)

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:
Expand All @@ -229,13 +229,13 @@ static bool launchExecutable (const String& pathAndArguments)
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:
Expand Down
8 changes: 3 additions & 5 deletions modules/juce_core/system/juce_SystemStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,9 @@ bool SystemStats::isRunningInAppExtensionSandbox() noexcept
bundle = bundle.getParentDirectory().getParentDirectory();
#endif

if (! bundle.isDirectory())
return false;
if (bundle.isDirectory())
return (bundle.getFileExtension() == ".appex");
#endif

return (bundle.getFileExtension() == ".appex");
#else
return false;
#endif
}

0 comments on commit 8f7d9f7

Please sign in to comment.