@@ -15,16 +15,15 @@ public class OpenTerminalUtil {
1515 * runs a command in a new terminal window.
1616 * the sh name is the file name you want the shell script stored. The appId is to locate your folder
1717 */
18- public static Process runInNewTerminal (OpenTerminal ot , String appId , String appName , String shName , String command ) throws IOException
18+ public static Process runInNewTerminal (File appdata , String terminal , String appName , String shName , String command ) throws IOException
1919 {
2020 if (OSUtil .isWindows ())
2121 {
22- return runInTerminal (ot . terminal , " start " + "\" " + appName + "\" " + command );
22+ return runInTerminal (terminal , " start " + "\" " + appName + "\" " + command );
2323 }
2424 else if (OSUtil .isMac ())
2525 {
26- genAS (ot .terminal );
27- File appdata = ot .getAppdata (appId );
26+ genAS (terminal );
2827 File sh = new File (appdata , shName + ".sh" );
2928 List <String > cmds = new ArrayList <>();
3029 cmds .add ("#!/bin/bash" );
@@ -37,11 +36,11 @@ else if(OSUtil.isMac())
3736 cmds .add ("osascript " + OpenTerminalConstants .closeMe .getPath ().replaceAll (" " , "\\ \\ " ) + " & exit" );
3837 IOUtils .saveFileLines (cmds , sh , true );//save the file
3938 IOUtils .makeExe (sh );//make it executable
40- return runInTerminal (ot . terminal , "osascript " + OpenTerminalConstants .start .getPath ().replaceAll (" " , "\\ \\ " ) + " \" " + sh .getPath ().replaceAll (" " , "\\ \\ " ) + "\" " );
39+ return runInTerminal (terminal , "osascript " + OpenTerminalConstants .start .getPath ().replaceAll (" " , "\\ \\ " ) + " \" " + sh .getPath ().replaceAll (" " , "\\ \\ " ) + "\" " );
4140 }
4241 else if (OSUtil .isLinux ())
4342 {
44- File sh = new File (ot . getAppdata ( appId ) , shName + ".sh" );
43+ File sh = new File (terminal , shName + ".sh" );
4544 List <String > cmds = new ArrayList <>();
4645 cmds .add ("#!/bin/bash" );
4746 cmds .add ("set +v" );//@Echo off
0 commit comments