cmdline launcher should use "open -a" cmd on MacOS, otherwise at least 32/64 bit mode setting wont be correct.

This commit is contained in:
Roman Chernyatchik
2011-02-21 22:00:34 +03:00
parent e84bc3af06
commit 991df2761b
2 changed files with 12 additions and 4 deletions
@@ -137,7 +137,8 @@ public class CreateLauncherScriptAction extends AnAction {
String homePath = PathManager.getHomePath();
String productName = ApplicationNamesInfo.getInstance().getProductName().toLowerCase();
if (SystemInfo.isMac) {
launcherContents = launcherContents.replace("$RUN_PATH$", homePath + "/Contents/MacOS/" + productName);
// Just use "*.app"
launcherContents = launcherContents.replace("$RUN_PATH$", homePath);
}
else {
launcherContents = launcherContents.replace("$RUN_PATH$", homePath + "/bin/" + productName + ".sh");
+10 -3
View File
@@ -69,6 +69,13 @@ if port == -1:
else:
if launch_with_port(port): exit()
bin_dir, bin_file = os.path.split(RUN_PATH)
os.chdir(bin_dir)
os.execv(bin_file, [bin_file] + args)
if sys.platform == "darwin":
# Mac OS: RUN_PATH is *.app path
if len(args):
args.insert(0, "--args")
os.execvp("open", ["-a", RUN_PATH] + args)
else:
# unix common
bin_dir, bin_file = os.path.split(RUN_PATH)
os.chdir(bin_dir)
os.execv(bin_file, [bin_file] + args)