Add parameters to the macOS browser command

Add parameters to the open command, so that it waits for the process to
end. Otherwise the process returns immediately and causes ctbrec to go
on even though the login process didn't run in the browser.

Furthermore we now pass on the config dir for the minimal browser as a
command line argument
This commit is contained in:
0xb00bface 2020-12-06 18:40:12 +01:00
parent 281d70d29b
commit 7d3e65fc14
1 changed files with 10 additions and 4 deletions

View File

@ -86,10 +86,16 @@ public class OS {
System.arraycopy(args, 0, cmd, 1, args.length);
break;
case MAC:
cmd = new String[args.length + 2];
cmd[0] = "open";
cmd[1] = new File(browserDir, "ctbrec-minimal-browser.app").getAbsolutePath();
System.arraycopy(args, 0, cmd, 2, args.length);
cmd = new String[args.length + 5];
int index = 0;
cmd[index++] = "open";
cmd[index++] = "-W";
cmd[index++] = "-a";
cmd[index++] = new File(browserDir, "ctbrec-minimal-browser.app").getAbsolutePath();
if (args.length > 0) {
cmd[index] = "--args";
System.arraycopy(args, 0, cmd, 5, args.length);
}
break;
default:
throw new UnsupportedOperatingSystemException(System.getProperty(OS_NAME));