Lazy-load chalk

Change-type: patch
This commit is contained in:
Pagan Gazzard
2020-02-28 15:25:12 +00:00
parent 0ab0e417b8
commit 98152c0b09
12 changed files with 34 additions and 32 deletions

View File

@ -16,13 +16,12 @@ limitations under the License.
import { BalenaApplicationNotFound } from 'balena-errors';
import * as BalenaSdk from 'balena-sdk';
import Bluebird = require('bluebird');
import chalk from 'chalk';
import { stripIndent } from 'common-tags';
import _ = require('lodash');
import _form = require('resin-cli-form');
import { NotLoggedInError } from '../errors';
import { getBalenaSdk, getVisuals } from './lazy';
import { getBalenaSdk, getChalk, getVisuals } from './lazy';
import messages = require('./messages');
import validation = require('./validation');
@ -431,6 +430,7 @@ export function selectFromList<T>(
}
export function printErrorMessage(message: string) {
const chalk = getChalk();
console.error(chalk.red(message));
console.error(chalk.red(`\n${messages.getHelp}\n`));
}