How to use the @absolunet/terminal.terminal.echoIndent function in @absolunet/terminal

To help you get started, we’ve selected a few @absolunet/terminal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github absolunet / nwayo / packages / workflow / cli / doctor.js View on Github external
const reporter = (title, reports) => {
	let success;

	const titleColor = reports.summary.success ? chalk.green : chalk.red;
	terminal.echo(`${chalk.cyan(title)} diagnosis  ${titleColor(`${reports.summary.success ? '(^_^)' : 'ಠ_ಠ'} ${reports.summary.nb ? ` [${reports.summary.nb.success}/${reports.summary.nb.total}]` : ''}`)}\n`);

	totals.success += reports.summary.nb.success;
	totals.failure += reports.summary.nb.failure;

	if (reports.summary.success && !verbose) {
		terminal.echoIndent(chalk.green(`${figures.tick}  ${reports.summary.nb.total === 1 ? reports.last.message : 'All tests passed'}`));
	} else {

		reports.list.forEach((test) => {
			if (test.success && verbose) {
				terminal.echoIndent(`${chalk.green(figures.tick)}  ${chalk.dim(test.message)}`);

			} else if (!test.success) {

				let extra = '';
				if (test.differences) {
					extra += test.differences.superfluous && test.differences.superfluous.length !== 0 ? chalk.yellow(` [+] ${test.differences.superfluous.join(' | ')}`) : '';
					extra += test.differences.missing     && test.differences.missing.length !== 0     ? chalk.red(` [-] ${test.differences.missing.join(' | ')}`) : '';
					extra += test.differences.mismatched  && test.differences.mismatched.length !== 0  ? chalk.red(` [*] ${test.differences.mismatched.join(' | ')}`) : '';
				}

				if (test.outdated) {
github absolunet / nwayo / packages / workflow / cli / doctor.js View on Github external
reports.list.forEach((test) => {
			if (test.success && verbose) {
				terminal.echoIndent(`${chalk.green(figures.tick)}  ${chalk.dim(test.message)}`);

			} else if (!test.success) {

				let extra = '';
				if (test.differences) {
					extra += test.differences.superfluous && test.differences.superfluous.length !== 0 ? chalk.yellow(` [+] ${test.differences.superfluous.join(' | ')}`) : '';
					extra += test.differences.missing     && test.differences.missing.length !== 0     ? chalk.red(` [-] ${test.differences.missing.join(' | ')}`) : '';
					extra += test.differences.mismatched  && test.differences.mismatched.length !== 0  ? chalk.red(` [*] ${test.differences.mismatched.join(' | ')}`) : '';
				}

				if (test.outdated) {
					extra += `  ${chalk.dim(test.outdated.current)}${chalk.yellow(test.outdated.latest)}`;
				}

				if (test.linterOutput) {
					extra += `\n${test.linterOutput}`;