[^yole] IDEA-102386 Cannot open additional project from console

This commit is contained in:
peter
2013-03-07 21:18:46 +01:00
parent d23aa6c645
commit 00c460b6c1
3 changed files with 5 additions and 2 deletions
@@ -168,6 +168,9 @@ public class CommandLineProcessor {
if (StringUtil.isQuotedString(arg)) {
arg = StringUtil.stripQuotesAroundValue(arg);
}
if (currentDirectory != null) {
arg = new File(currentDirectory, arg).getAbsolutePath();
}
if (line != -1) {
final VirtualFile virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByPath(arg);
if (virtualFile != null) {
@@ -161,7 +161,7 @@ public class SocketLock {
if (result.contains(path)) {
try {
DataOutputStream out = new DataOutputStream(socket.getOutputStream());
out.writeUTF(ACTIVATE_COMMAND + StringUtil.join(args, "\0"));
out.writeUTF(ACTIVATE_COMMAND + new File(".").getAbsolutePath() + "\0" + StringUtil.join(args, "\0"));
out.flush();
String response = in.readUTF();
if (response.equals("ok")) {
@@ -251,7 +251,7 @@ public class ApplicationImpl extends ComponentManagerImpl implements Application
invokeLater(new Runnable() {
@Override
public void run() {
final Project project = CommandLineProcessor.processExternalCommandLine(args, null);
final Project project = CommandLineProcessor.processExternalCommandLine(args.subList(1, args.size()), args.get(0));
final JFrame frame;
if (project != null) {
frame = (JFrame)WindowManager.getInstance().getIdeFrame(project);