use of org.zmlx.hg4idea.execution.ShellCommand in project intellij-community by JetBrains.
the class HgExecutor method hg.
public static String hg(@NotNull String command, boolean ignoreNonZeroExitCode) {
List<String> split = splitCommandInParameters(command);
split.add(0, HG_EXECUTABLE);
debug("hg " + command);
HgCommandResult result;
try {
result = new ShellCommand(split, pwd(), null).execute(false, false);
} catch (Exception e) {
throw new RuntimeException(e);
}
int exitValue = result.getExitValue();
if (!ignoreNonZeroExitCode && exitValue != 0) {
throw new RuntimeException(result.getRawError());
}
return result.getRawOutput();
}
use of org.zmlx.hg4idea.execution.ShellCommand in project intellij-community by JetBrains.
the class HgUtil method getVersionOutput.
@NotNull
public static HgCommandResult getVersionOutput(@NotNull String executable) throws ShellCommandException, InterruptedException {
String hgExecutable = executable.trim();
List<String> cmdArgs = new ArrayList<>();
cmdArgs.add(hgExecutable);
cmdArgs.add("version");
cmdArgs.add("-q");
ShellCommand shellCommand = new ShellCommand(cmdArgs, null, CharsetToolkit.getDefaultSystemCharset());
return shellCommand.execute(false, false);
}
Aggregations