本文整理汇总了TypeScript中chalk.bold.green方法的典型用法代码示例。如果您正苦于以下问题:TypeScript bold.green方法的具体用法?TypeScript bold.green怎么用?TypeScript bold.green使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chalk.bold
的用法示例。
在下文中一共展示了bold.green方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: debug
tailer.on('exit', (result, details) => {
debug('python tailer exited');
if (result === 'error') {
debug('Installer: Tailer found error with installer', details);
reject(new Error(`Found error with Python installer: ${details}`));
}
if (result === 'success') {
pythonLastLines = [ chalk.bold.green('Successfully installed Python 2.7') ];
debug('Installer: Successfully installed Python 2.7 according to tailer');
resolve({
installPath: details || getPythonInstallerPath().targetPath,
toConfigure: true,
success: true
});
}
if (result === 'failure') {
log(chalk.bold.red('\nCould not install Python 2.7.'));
log('Please find more details in the log files, which can be found at');
log(getWorkDirectory() + '\n');
debug('Installer: Failed to install Python 2.7 according to tailer');
resolve({
success: false
});
}
});
示例2: success
export function success(...args: any[]) {
if (args.length > 1) {
args[0] = chalk.bold.green(args[0]);
}
log.apply(console, args);
}
示例3: function
conn.on('ready', function() {
console.log(chalk.bold.green('Connected to node1 as root'));
conn.shell(function(err, stream) {
if (err) throw err;
stream.on('close', function() {
if (errorMsg.length > 0) {
console.log(chalk.bold.red('Error is:') + errorMsg);
console.log(chalk.red.bgBlack.bold('Unable to truncate metron_update table in HBase. Most likely reason is HBase is down !!!'));
reject();
} else {
console.log(chalk.bold.green('Truncated metron_update table in HBase'));
resolve();
}
conn.end();
}).on('data', function(data) {
console.log('STDOUT: ' + data);
if (data.indexOf('ERROR') !== -1) {
errorMsg = data;
}
}).stderr.on('data', function(data) {
console.log('STDERR: ' + data);
});
var comands = [
'echo \'truncate "metron_update"\' | /usr/hdp/current/hbase-master/bin/hbase shell',
'exit',
''
];
stream.end(comands.join('\r\n'));
});
}).connect({
示例4: switch
diffResult.diffSet.forEach(function(entry) {
switch (entry.state) {
case 'equal':
return;
case 'left':
const expectedFileRelPath =
path.join(entry.relativePath || '/', entry.name1);
errorOutputLines.push((chalk.bold.green(' + ' + expectedFileRelPath)));
return;
case 'right':
const actualFileRelPath =
path.join(entry.relativePath || '/', entry.name2);
errorOutputLines.push((chalk.bold.red(' - ' + actualFileRelPath)));
return;
case 'distinct':
const diffedFileRelPath =
path.join(entry.relativePath || '/', entry.name1);
const expectedFilePath = path.join(entry.path1, entry.name1);
const actualFilePath = path.join(entry.path2, entry.name2);
const patch = diff.createPatch(
'string',
fs.readFileSync(expectedFilePath, 'utf8'),
fs.readFileSync(actualFilePath, 'utf8'),
'expected',
'converted');
errorOutputLines.push((chalk.bold.red('<> ' + diffedFileRelPath)));
errorOutputLines.push(formatDiffPatch(patch));
return;
default:
throw new Error('Unexpected diff-entry format: ' + entry);
}
});
示例5: _drawUIDoneWithSkipped
private _drawUIDoneWithSkipped() {
this._pipe.write(CLEAR);
const numPass = this._countPaths - this._testAssertions.length;
let stats = chalk.bold.dim(
pluralize('snapshot', this._countPaths) + ' reviewed',
);
if (numPass) {
stats +=
', ' + chalk.bold.green(pluralize('snapshot', numPass) + ' updated');
}
if (this._skippedNum) {
stats +=
', ' +
chalk.bold.yellow(pluralize('snapshot', this._skippedNum) + ' skipped');
}
const messages = [
'\n' + chalk.bold('Interactive Snapshot Result'),
ARROW + stats,
'\n' + chalk.bold('Watch Usage'),
chalk.dim(ARROW + 'Press ') +
'r' +
chalk.dim(' to restart Interactive Snapshot Mode.'),
chalk.dim(ARROW + 'Press ') +
'q' +
chalk.dim(' to quit Interactive Snapshot Mode.'),
];
this._pipe.write(messages.filter(Boolean).join('\n') + '\n');
}
示例6: constructor
constructor(oldCmd: string, newCmd: string) {
super(
`The ${chalk.bold(oldCmd)} command has been replaced by the ${chalk.bold(
newCmd,
)} command.
Get more info with ${chalk.bold.green(`${newCmd} --help`)}`,
)
}
示例7: setEnvironment
export function setEnvironment(env: InstallationDetails): Promise<void> {
const scriptPath = IS_DRY_RUN
? path.join(__dirname, '..', 'ps1', 'dry-run.ps1')
: path.join(__dirname, '..', 'ps1', 'set-environment.ps1');
let pythonArguments = '';
let buildArguments = '';
// Should we configure Python?
if (env.python.toConfigure) {
const pythonPath = path.join(env.python.installPath);
const pythonExePath = path.join(pythonPath, 'python.exe');
pythonArguments += ` -ConfigurePython -pythonPath '${pythonPath}' -pythonExePath '${pythonExePath}'`;
}
// Should we configure the VS Build Tools?
if (env.buildTools.toConfigure) {
const vccParam = `-VisualStudioVersion '${BUILD_TOOLS.version.toString()}'`;
buildArguments += ` -ConfigureBuildTools ${vccParam}`;
}
// Log what we're doing
if (pythonArguments && buildArguments) {
log(chalk.bold.green(`Now configuring the Visual Studio Build Tools and Python...`));
} else if (pythonArguments) {
log(chalk.bold.green(`Now configuring Python...`));
} else if (buildArguments) {
log(chalk.bold.green(`Now configuring the Visual Studio Build Tools..`));
} else {
log(chalk.bold.green(`Skipping configuration: No configuration for Python or Visual Studio Build Tools required.`));
return(new Promise((resolve, reject) => resolve()))
.then(() => log(chalk.bold.green(`\nAll done!\n`)));
}
const maybeArgs = `${pythonArguments}${buildArguments}`;
const psArgs = `& {& '${scriptPath}' ${maybeArgs} }`;
const args = ['-ExecutionPolicy', 'Bypass', '-NoProfile', '-NoLogo', psArgs];
return executeChildProcess('powershell.exe', args)
.then(() => log(chalk.bold.green(`\nAll done!\n`)))
.catch((error) => debug(`Encountered environment setting error: ${error}`));
}
示例8: createReporterError
export function createReporterError(
reporterIndex: number,
reporterValue: Array<Config.ReporterConfig> | string,
) {
const errorMessage =
` Reporter at index ${reporterIndex} must be of type:\n` +
` ${chalk.bold.green(validReporterTypes.join(' or '))}\n` +
` but instead received:\n` +
` ${chalk.bold.red(getType(reporterValue))}`;
return new ValidationError(ERROR, errorMessage, DOCUMENTATION_NOTE);
}