mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-08-14 13:26:58 +00:00
Merge branch better-commands
This commit is contained in:
@@ -5,6 +5,7 @@ import io.xpipe.app.browser.OpenFileSystemModel;
|
||||
import io.xpipe.app.browser.action.BrowserActionFormatter;
|
||||
import io.xpipe.app.browser.action.MultiExecuteAction;
|
||||
import io.xpipe.app.browser.icon.BrowserIconFileType;
|
||||
import io.xpipe.core.process.CommandBuilder;
|
||||
import io.xpipe.core.process.ShellControl;
|
||||
|
||||
import java.util.List;
|
||||
@@ -27,8 +28,8 @@ public class JarAction extends MultiExecuteAction implements JavaAction, FileTyp
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String createCommand(ShellControl sc, OpenFileSystemModel model, BrowserEntry entry) {
|
||||
return "java -jar " + entry.getOptionallyQuotedFileName();
|
||||
protected CommandBuilder createCommand(ShellControl sc, OpenFileSystemModel model, BrowserEntry entry) {
|
||||
return CommandBuilder.of().add("java", "-jar").addFile(entry.getRawFileEntry().getPath());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.xpipe.ext.base.browser;
|
||||
import io.xpipe.app.browser.BrowserEntry;
|
||||
import io.xpipe.app.browser.OpenFileSystemModel;
|
||||
import io.xpipe.app.browser.action.MultiExecuteAction;
|
||||
import io.xpipe.core.process.CommandBuilder;
|
||||
import io.xpipe.core.process.OsType;
|
||||
import io.xpipe.core.process.ShellControl;
|
||||
import io.xpipe.core.process.ShellDialects;
|
||||
@@ -69,8 +70,7 @@ public class RunAction extends MultiExecuteAction {
|
||||
return entries.stream().allMatch(entry -> isExecutable(entry.getRawFileEntry()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String createCommand(ShellControl sc, OpenFileSystemModel model, BrowserEntry entry) {
|
||||
return sc.getShellDialect().runScriptCommand(sc, entry.getRawFileEntry().getPath());
|
||||
protected CommandBuilder createCommand(ShellControl sc, OpenFileSystemModel model, BrowserEntry entry) {
|
||||
return CommandBuilder.of().add(sc.getShellDialect().runScriptCommand(sc, entry.getRawFileEntry().getPath()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user