Merge remote-tracking branch 'apache/4.19'

This commit is contained in:
Abhishek Kumar 2024-07-08 11:36:44 +05:30
commit 1144f5258d

View File

@ -661,8 +661,8 @@ public class Script implements Callable<String> {
return executable;
}
private static Script getScriptForCommandRun(String... command) {
Script s = new Script(command[0], 0);
private static Script getScriptForCommandRun(long timeout, String... command) {
Script s = new Script(command[0], timeout);
if (command.length > 1) {
for (int i = 1; i < command.length; ++i) {
s.add(command[i]);
@ -671,12 +671,16 @@ public class Script implements Callable<String> {
return s;
}
private static Script getScriptForCommandRun(String... command) {
return getScriptForCommandRun(0, command);
}
public static String executeCommand(String... command) {
return runScript(getScriptForCommandRun(command));
}
public static int executeCommandForExitValue(long timeout, String... command) {
return runScriptForExitValue(getScriptForCommandRun(command));
return runScriptForExitValue(getScriptForCommandRun(timeout, command));
}
public static int executeCommandForExitValue(String... command) {