mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform] more reliable way to reveal a file in Finder (IDEA-161700)
This commit is contained in:
@@ -289,17 +289,8 @@ public class ShowFilePathAction extends AnAction {
|
||||
}
|
||||
|
||||
if (SystemInfo.isMac) {
|
||||
if (toSelect != null) {
|
||||
final String script = String.format(
|
||||
"tell application \"Finder\"\n" +
|
||||
"\treveal {\"%s\"} as POSIX file\n" +
|
||||
"\tactivate\n" +
|
||||
"end tell", toSelect);
|
||||
new GeneralCommandLine(ExecUtil.getOsascriptPath(), "-e", script).createProcess();
|
||||
}
|
||||
else {
|
||||
new GeneralCommandLine("open", dir).createProcess();
|
||||
}
|
||||
GeneralCommandLine cmd = toSelect != null ? new GeneralCommandLine("open", "-R", toSelect) : new GeneralCommandLine("open", dir);
|
||||
cmd.createProcess();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user