mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-07 11:09:49 +08:00
Add support for stdin for background TermuxTasks
This will allow passing scripts (to bash or python) or other data to an executable via stdin. Arguments are passed to the executable and not the script.
This commit is contained in:
@@ -74,6 +74,8 @@ public class ExecutionCommand {
|
||||
public Uri executableUri;
|
||||
/** The executable arguments array for the {@link ExecutionCommand}. */
|
||||
public String[] arguments;
|
||||
/** The stdin string for the {@link ExecutionCommand}. */
|
||||
public String stdin;
|
||||
/** The current working directory for the {@link ExecutionCommand}. */
|
||||
public String workingDirectory;
|
||||
|
||||
@@ -138,10 +140,11 @@ public class ExecutionCommand {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public ExecutionCommand(Integer id, String executable, String[] arguments, String workingDirectory, boolean inBackground, boolean isFailsafe) {
|
||||
public ExecutionCommand(Integer id, String executable, String[] arguments, String stdin, String workingDirectory, boolean inBackground, boolean isFailsafe) {
|
||||
this.id = id;
|
||||
this.executable = executable;
|
||||
this.arguments = arguments;
|
||||
this.stdin = stdin;
|
||||
this.workingDirectory = workingDirectory;
|
||||
this.inBackground = inBackground;
|
||||
this.isFailsafe = isFailsafe;
|
||||
@@ -560,4 +563,8 @@ public class ExecutionCommand {
|
||||
return currentState == ExecutionState.EXECUTING;
|
||||
}
|
||||
|
||||
public synchronized boolean isSuccessful() {
|
||||
return currentState == ExecutionState.SUCCESS;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user