mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
make headless patch work for product.app folder as well
This commit is contained in:
@@ -25,6 +25,7 @@ import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* @author Konstantin Bulenkov
|
||||
@@ -38,6 +39,12 @@ public class Bootstrap {
|
||||
InvocationTargetException, IllegalAccessException, InterruptedException {
|
||||
if (args.length != 1) return;
|
||||
String path = args[0].endsWith("\\") || args[0].endsWith("/") ? args[0] : args[0] + File.separator;
|
||||
if (isMac() && path.endsWith(".app/")) {
|
||||
final File file = new File(path + "Contents");
|
||||
if (file.exists() && file.isDirectory()) {
|
||||
path += "Contents/";
|
||||
}
|
||||
}
|
||||
|
||||
cleanUp();
|
||||
|
||||
@@ -107,4 +114,8 @@ public class Bootstrap {
|
||||
//noinspection CallToPrintStackTrace
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
private static boolean isMac() {
|
||||
return System.getProperty("os.name").toLowerCase(Locale.US).startsWith("mac");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user