Skip to content

Commit

Permalink
Use parent_path for app bundle directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
squidbus committed Mar 5, 2025
1 parent 535741d commit c566c65
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions UnleashedRecomp/os/macos/process_macos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static CFURLRef UntranslocateBundlePath(const CFURLRef bundlePath)

std::filesystem::path os::process::GetExecutableRoot()
{
std::filesystem::path appPath = GetExecutablePath();
std::filesystem::path resultPath = GetExecutablePath().remove_filename();
if (CFBundleRef bundleRef = CFBundleGetMainBundle())
{
if (CFURLRef bundleUrlRef = CFBundleCopyBundleURL(bundleRef))
Expand All @@ -66,7 +66,7 @@ std::filesystem::path os::process::GetExecutableRoot()
untranslocatedUrlRef ? untranslocatedUrlRef : bundleUrlRef, true,
reinterpret_cast<uint8_t*>(appBundlePath), sizeof(appBundlePath)))
{
appPath = std::filesystem::path(appBundlePath);
resultPath = std::filesystem::path(appBundlePath).parent_path();
}

if (untranslocatedUrlRef)
Expand All @@ -76,7 +76,7 @@ std::filesystem::path os::process::GetExecutableRoot()
CFRelease(bundleUrlRef);
}
}
return appPath.remove_filename();
return resultPath;
}

std::filesystem::path os::process::GetWorkingDirectory()
Expand Down

0 comments on commit c566c65

Please sign in to comment.