mirror of
https://github.com/nix-community/nix-on-droid-app.git
synced 2025-11-28 13:11:08 +01: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:
parent
824b3e657f
commit
192b208883
5 changed files with 70 additions and 18 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue