macOS: Support configuration of the main bundle path (fixes issue #2729)

This commit is contained in:
Rob Sussman
2019-07-25 15:47:46 +00:00
committed by Marshall Greenblatt
parent cd8efe748c
commit ffb9266853
7 changed files with 26 additions and 0 deletions

View File

@@ -65,6 +65,12 @@ base::FilePath GetMainProcessPath() {
}
base::FilePath GetMainBundlePath() {
base::FilePath main_bundle_path =
base::CommandLine::ForCurrentProcess()->GetSwitchValuePath(
switches::kMainBundlePath);
if (!main_bundle_path.empty())
return main_bundle_path;
return base::mac::GetAppBundlePath(GetMainProcessPath());
}