本文整理汇总了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}`));
}
}
示例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}`);
示例3: debug
export function debug(text: string) {
if (Config.debuglevel > 2) return
console.log(blue('debug') + ' ' + text)
}