Created
October 24, 2019 19:20
-
-
Save RobertApikyan/bc59263e04a62a980cc88badc2687501 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void runProcess(String cmd) { | |
ProcessBuilder processBuilder = new ProcessBuilder(); | |
String cmdCode = "~/vendor/bin/terminus remote:drush mentorcliq-americamentors.jenkins -- scr scripts/check-self-matching-requests.php -- \"2019-10-27 00:18:54.86\""; | |
processBuilder.command("C:\\Program Files\\Git\\git-bash.exe", cmdCode); | |
try { | |
Process process = processBuilder.start(); | |
BufferedReader reader = | |
new BufferedReader(new InputStreamReader(process.getInputStream())); | |
StringBuilder builder = new StringBuilder(); | |
String line; | |
while ((line = reader.readLine()) != null) { | |
builder.append(line); | |
System.out.println(line); | |
} | |
String result = builder.toString(); | |
int exitCode = process.waitFor(); | |
} catch (IOException | InterruptedException e) { | |
e.printStackTrace(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment