本文整理汇总了TypeScript中cli-color.xterm函数的典型用法代码示例。如果您正苦于以下问题:TypeScript xterm函数的具体用法?TypeScript xterm怎么用?TypeScript xterm使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xterm函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: deploy
deploy():Q.IPromise<IDeployResult> {
let start = new Date().getTime(),
config = this.serviceContainer.config,
packageData:any = JSON.parse('' + fs.readFileSync(__dirname + '/../../package.json'));
this.log.logAndKeepColors(
color.yellow(
"\n\n+----------------------------------------------------+" +
"\n| ") + color.xterm(200).bold('Mouflon - your deployment manager') + ' ' + (' v' + packageData.version).substr(-10, 10) + color.yellow(" |" +
"\n+----------------------------------------------------+") +
"\n\n");
this.log.startSection(`Deploying "${config.projectName}" to "${config.stageName}"...`);
this.log.debug('Timestamp is ' + color.whiteBright.bold(this.timestamp));
if (config.verbose) {
this.log.debug('Verbose mode is enabled');
}
this.log.debug('Working pathConfig: ' + config.pathConfig.getReadable());
return this.deployManager.deploy().then(() => {
let end = new Date().getTime();
let result: IDeployResult = {
project: config.projectName,
stage: config.stageName,
projectConfig: config.projectConfig,
globalConfig: config.globalConfig,
start: start,
end: end,
};
return result;
});
}
示例2: exitWithError
static exitWithError(errorMessage: string) {
console.log(
color.yellow(
"\n+----------------------------------------------+" +
"\n| ") + color.xterm(200).bold('An error occurred - Can\'t continue') + color.yellow(" |" +
"\n+----------------------------------------------+") +
"\n" +
"\nError:\n" +
color.red.bold(errorMessage) +
"\n");
process.exit(1);
}
示例3: deploy
deploy() {
var start = (new Date()).getTime(),
deployPromise: Q.IPromise<boolean>,
config = this.serviceContainer.config,
packageData: any = JSON.parse('' + fs.readFileSync(__dirname + '/../../package.json'));
this.serviceContainer.log.logAndKeepColors(
color.yellow(
"\n\n+----------------------------------------------------+" +
"\n| ") + color.xterm(200).bold('Mouflon - your deployment manager') + ' ' + (' v' + packageData.version).substr(-10, 10) + color.yellow(" |" +
"\n+----------------------------------------------------+") +
"\n\n");
this.serviceContainer.log.startSection(sprintf('Deploying "%s" to "%s"...', config.projectName, config.stageName));
this.serviceContainer.log.debug('Timestamp is ' + color.whiteBright.bold(this.timestamp));
if (this.serviceContainer.config.verbose) {
this.serviceContainer.log.debug('Verbose mode is enabled');
}
this.serviceContainer.log.debug('Working paths: ' + this.serviceContainer.config.paths.getReadable());
deployPromise = this.deployManager.deploy();
deployPromise.then(
() => {
var end = (new Date()).getTime();
this.serviceContainer.log.closeSection(sprintf(
'It took %ss to deploy "%s" to "%s". :)' + "\n\n",
(0.001 * (end - start)).toFixed(3),
config.projectName,
config.stageName
));
},
(error) => {
Utils.exitWithError(error);
}
);
}