Skip to content

Commit 1f6dd01

Browse files
author
jredfox
committed
backup
1 parent 4077f28 commit 1f6dd01

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/jredfox/terminal/OpenTerminal.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public Process launch(boolean open)
8484
String shName = this.app.id.contains("/") ? JavaUtil.getLastSplit(this.app.id, "/") : this.app.id;
8585
try
8686
{
87-
return OpenTerminalUtil.runInNewTerminal(this, this.app.id, this.app.name, shName, command);
87+
return OpenTerminalUtil.runInNewTerminal(this.getAppdata(this.app.id), this.app.terminal, this.app.name, shName, command);
8888
}
8989
catch(Throwable t)
9090
{

src/jredfox/terminal/OpenTerminalUtil.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)