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


TypeScript safe.blue函数代码示例

本文整理汇总了TypeScript中colors/safe.blue函数的典型用法代码示例。如果您正苦于以下问题:TypeScript blue函数的具体用法?TypeScript blue怎么用?TypeScript blue使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了blue函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: status

    export function status(options: any) {
        if (!!options.quiet) log.silence();
        var repo = cwdRepo();
        var res = Client.status(repo);

        var mod = 'not modified';
        if (res.anyChanges) mod = 'modified';
        if (res.anyStagedChanges) mod += ', staged';
        if (!!repo.merging) {
            mod = 'merging';
        }
        var curCommit = repo.currentBranchName;
        if (!curCommit) {
            curCommit = 'HEAD #' + repo.head.head.substring(0, 7);
        }

        log.info(colors.blue(repo.name), '>', colors.yellow(curCommit), '>', colors.bold(mod));
        if (res.anyNewChanges) {
            log.info('changes not staged for commit:');

            res.modified.forEach(v => log.log(`    ${colors.red('modified:')}  ${v}`));
            res.added.forEach(v => log.log(`    ${colors.red('added:')}  ${v}`));
            res.removed.forEach(v => log.log(`    ${colors.red('removed:')}  ${v}`));
        }
        if (res.anyStagedChanges) {
            log.info('changes to be committed:');
            res.modifiedStaged.forEach(v => log.log(`    ${colors.green('modified:')}  ${v}`));
            res.addedStaged.forEach(v => log.log(`    ${colors.green('added:')}  ${v}`));
            res.removedStaged.forEach(v => log.log(`    ${colors.green('removed:')}  ${v}`));
        }
    }
开发者ID:STALKER2010,项目名称:jerk,代码行数:31,代码来源:cli.ts

示例2:

	console.log(colors.green("git status is good - I can continue..."));
}

const releaseTypes = ["major", "premajor", "minor", "preminor", "patch", "prepatch", "prerelease"];

const releaseType = argv._[0] || "patch";
let newVersion = releaseType;
const oldVersion = pack.version as string;
if (releaseTypes.indexOf(releaseType) > -1) {
	if (releaseType.startsWith("pre") && argv._.length >= 2) {
		// increment to pre-release with an additional prerelease string
		newVersion = semver.inc(oldVersion, releaseType, argv._[1]);
	} else {
		newVersion = semver.inc(oldVersion, releaseType);
	}
	console.log(`bumping version ${colors.blue(oldVersion)} to ${colors.gray(releaseType)} version ${colors.green(newVersion)}\n`);
} else {
	// increment to specific version
	newVersion = semver.clean(newVersion);
	if (newVersion == null) {
		fail(`invalid version string "${newVersion}"`);
	} else {
		// valid version string => check if its actually newer
		if (!semver.gt(newVersion, pack.version)) {
			fail(`new version ${newVersion} is NOT > than package.json version ${pack.version}`);
		}
		// if (!semver.gt(newVersion, ioPack.common.version)) {
		// 	fail(`new version ${newVersion} is NOT > than io-package.json version ${ioPack.common.version}`);
		// }
	}
	console.log(`bumping version ${oldVersion} to specific version ${newVersion}`);
开发者ID:AlCalzone,项目名称:shared-utils,代码行数:31,代码来源:release.ts

示例3: debug

export function debug(text: string) {
    if (Config.debuglevel > 2) return
    console.log(blue('debug') + ' ' + text)
}
开发者ID:KewlStatics,项目名称:SocialMedia-bot,代码行数:4,代码来源:utils.ts


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