本文整理汇总了TypeScript中@angular-devkit/core.terminal.red方法的典型用法代码示例。如果您正苦于以下问题:TypeScript terminal.red方法的具体用法?TypeScript terminal.red怎么用?TypeScript terminal.red使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular-devkit/core.terminal
的用法示例。
在下文中一共展示了terminal.red方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: resolve
.on('close', (code: number) => {
if (code === 0) {
logger.info(terminal.green(`Installed packages for tooling via ${packageManager}.`));
resolve();
} else {
const message = 'Package install failed, see above.';
logger.info(terminal.red(message));
reject(message);
}
});
示例2:
color = (x) => terminal.bold(terminal.red(x));
示例4:
color = (x: string) => terminal.bold(terminal.red(x));
示例5: _executeTarget
async function _executeTarget(
parentLogger: logging.Logger,
workspace: experimental.workspace.Workspace,
root: string,
argv: minimist.ParsedArgs,
registry: json.schema.SchemaRegistry,
) {
const architectHost = new WorkspaceNodeModulesArchitectHost(workspace, root);
const architect = new Architect(architectHost, registry);
// Split a target into its parts.
const targetStr = argv._.shift() || '';
const [project, target, configuration] = targetStr.split(':');
const targetSpec = { project, target, configuration };
delete argv['help'];
delete argv['_'];
const logger = new logging.Logger('jobs');
const logs: logging.LogEntry[] = [];
logger.subscribe(entry => logs.push({ ...entry, message: `${entry.name}: ` + entry.message }));
const run = await architect.scheduleTarget(targetSpec, argv, { logger });
const bars = new MultiProgressBar<number, BarInfo>(':name :bar (:current/:total) :status');
run.progress.subscribe(
update => {
const data = bars.get(update.id) || {
id: update.id,
builder: update.builder,
target: update.target,
status: update.status || '',
name: ((update.target ? _targetStringFromTarget(update.target) : update.builder.name)
+ ' '.repeat(80)
).substr(0, 40),
};
if (update.status !== undefined) {
data.status = update.status;
}
switch (update.state) {
case BuilderProgressState.Error:
data.status = 'Error: ' + update.error;
bars.update(update.id, data);
break;
case BuilderProgressState.Stopped:
data.status = 'Done.';
bars.complete(update.id);
bars.update(update.id, data, update.total, update.total);
break;
case BuilderProgressState.Waiting:
bars.update(update.id, data);
break;
case BuilderProgressState.Running:
bars.update(update.id, data, update.current, update.total);
break;
}
bars.render();
},
);
// Wait for full completion of the builder.
try {
const { success } = await run.output.pipe(
tap(result => {
if (result.success) {
parentLogger.info(terminal.green('SUCCESS'));
} else {
parentLogger.info(terminal.yellow('FAILURE'));
}
parentLogger.info('Result: ' + JSON.stringify({ ...result, info: undefined }, null, 4));
parentLogger.info('\nLogs:');
logs.forEach(l => parentLogger.next(l));
logs.splice(0);
}),
).toPromise();
await run.stop();
bars.terminate();
return success ? 0 : 1;
} catch (err) {
parentLogger.info(terminal.red('ERROR'));
parentLogger.info('\nLogs:');
logs.forEach(l => parentLogger.next(l));
parentLogger.fatal('Exception:');
parentLogger.fatal(err.stack);
return 2;
}
}