if (reverseStdout) ps.readStdout(); if (reverseStderr) ps.readStderr();
public String runCommandForOutput(String command) throws DebianizingException { try { String actualCommand = MessageFormat.format("bash -c ''{0}''", command); return CharStreams.toString(new InputStreamReader(launcher.launch().cmdAsSingleString(actualCommand).readStdout().start().getStdout())); } catch (IOException e) { e.printStackTrace(listener.getLogger()); throw new DebianizingException(MessageFormat.format("Command <{0}> failed", command), e); } }
private void runCommentsRemoverProcess(FilePath workspace, Launcher launcher, TaskListener listener, File removerScriptDir, File outputDirPath) throws IOException, InterruptedException { String pythonPath = getDescriptor().getPythonPath(); String pipPath = getDescriptor().getPipPath(); String pipExecutable = StringUtils.isEmpty(pythonPath) ? "pip" : pipPath; String[] pipCommand = new String[]{pipExecutable, "install", "-r", removerScriptDir + File.separator + "requirements.txt", "-q"}; listener.getLogger().println("Installing pip requirements [" + StringUtils.join(pipCommand, " ") + "]..."); runProcess(launcher.launch().cmds(pipCommand).readStdout().start(), listener); String pythonExecutable = StringUtils.isEmpty(pythonPath) ? "python" : pythonPath; String[] commentsRemoverCommand = new String[]{pythonExecutable, removerScriptDir + File.separator + COMMENTS_REMOVER_ENTRY_FILE, workspace.getRemote() + File.separator + filename, language, outputDirPath.getAbsolutePath()}; listener.getLogger().println("Executing script [" + StringUtils.join(commentsRemoverCommand, " ") + "]..."); runProcess(launcher.launch().cmds(commentsRemoverCommand).readStdout().start(), listener); }
p.readStdout().readStderr(); Proc process = p.start();
.getSdkInstallAndUpdateCommand(proxySettings, components); ArgumentListBuilder cmd = Utils.getToolCommand(sdk, launcher.isUnix(), sdkInstallAndUpdateCmd); ProcStarter procStarter = launcher.launch().stderr(logger).readStdout().writeStdin().cmds(cmd);
if(workDir!=null) ps.pwd(workDir); if (reverseStdin) ps.writeStdin(); if (reverseStdout) ps.readStdout(); if (reverseStderr) ps.readStderr();