<commit_before>package com.liferay.blade.cli;

import java.lang.ProcessBuilder.Redirect;
import java.util.List;

public class UpdateCommand {
	public UpdateCommand(blade blade, UpdateOptions options) throws Exception {
		_blade = blade;
		_options = options;
	}

	public void execute() throws Exception {
		final List<String> args = _options._arguments();

		final String jarPath = args.size() > 0 ? args.get(0) : _DEFAULT_URL;

		ProcessBuilder processBuilder =
			new ProcessBuilder("jpm", "install", "-f", jarPath);

		processBuilder.redirectOutput(Redirect.INHERIT);
		processBuilder.redirectError(Redirect.INHERIT);

		Process process = processBuilder.start();

		int errCode = process.waitFor();

		if (errCode == 0) {
			System.out.println("Update completed successfully");
		}
	}

	private blade _blade;

	private UpdateOptions _options;

	private static final String _DEFAULT_URL =
		"https://liferay-test-01.ci.cloudbees.com/job/blade.tools/" +
		"lastSuccessfulBuild/artifact/com.liferay.blade.cli/generated/" +
		"com.liferay.blade.cli.jar";


}<commit_msg>Report errors to console.<commit_after>package com.liferay.blade.cli;

import java.lang.ProcessBuilder.Redirect;
import java.util.List;

public class UpdateCommand {

	public UpdateCommand(blade blade, UpdateOptions options) throws Exception {
		_blade = blade;
		_options = options;
	}

	public void execute() throws Exception {
		final List<String> args = _options._arguments();

		final String jarPath = args.size() > 0 ? args.get(0) : _DEFAULT_URL;

		ProcessBuilder processBuilder =
			new ProcessBuilder("jpm", "install", "-f", jarPath);

		processBuilder.redirectOutput(Redirect.INHERIT);
		processBuilder.redirectError(Redirect.INHERIT);

		Process process = processBuilder.start();

		int errCode = process.waitFor();

		if (errCode == 0) {
			_blade.out().println("Update completed successfully");
		}
		else {
			_blade.error("update: jpm exited with code: " + errCode);
		}
	}

	private blade _blade;

	private UpdateOptions _options;

	private static final String _DEFAULT_URL =
		"https://liferay-test-01.ci.cloudbees.com/job/blade.tools/" +
		"lastSuccessfulBuild/artifact/com.liferay.blade.cli/generated/" +
		"com.liferay.blade.cli.jar";


}
{'fraction_non_alphanumeric': 0.12213740458015267, 'fraction_numerical': 0.00449034575662326, 'mean_word_length': 4.528535980148884, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6987560', 'n_tokens_mistral': 754, 'n_tokens_neox': 696, 'n_words': 152}