当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript cli-color.xterm函数代码示例

本文整理汇总了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;
        });
    }
开发者ID:stvnwrgs,项目名称:mouflon,代码行数:33,代码来源:Mouflon.ts

示例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);
    }
开发者ID:reasn,项目名称:mouflon,代码行数:13,代码来源:Utils.ts

示例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);
            }
        );
    }
开发者ID:reasn,项目名称:mouflon,代码行数:37,代码来源:Mouflon.ts


注:本文中的cli-color.xterm函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。