Skip to content

Commit

Permalink
chore: ignore progress for CI (#5003)
Browse files Browse the repository at this point in the history
Co-authored-by: splincode <>
  • Loading branch information
splincode authored Jul 31, 2023
1 parent 49b4b3c commit 03c2ea5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
18 changes: 18 additions & 0 deletions projects/cdk/schematics/utils/is-ci.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/// <reference types="node" />

export function tuiIsCI(): boolean {
return (
process.env.TUI_CI === `true` ||
!!process.env.CI || // Another CI
!!process.env.GITHUB_ACTION || // Github CI
!!process.env.GITLAB_CI || // Gitlab CI
!!process.env.CIRCLECI || // Circle CI
!!process.env.TF_BUILD || // Azure CI
!!process.env.CIRRUS_CI || // Cirrus CI
!!process.env.BUILDKITE || // Build Kite CI
!!process.env.HEROKU_TEST_RUN_ID || // Heroku CI
!!process.env.CODEBUILD_BUILD_ID || // CodeBuild CI
!!process.env.TEAMCITY_VERSION || // TeamCity CI
!!process.env.BUILD_ID // Jenkins/Hudson
);
}
6 changes: 6 additions & 0 deletions projects/cdk/schematics/utils/progress.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/// <reference types="node" />
import {clearLine, cursorTo} from 'readline';

import {SMALL_TAB_SYMBOL, SUCCESS_SYMBOL} from './colored-log';
import {tuiIsCI} from './is-ci';

export function setupProgressLogger({
total,
Expand All @@ -14,6 +16,10 @@ export function setupProgressLogger({
let i = 1;

return (message: string, incrementIndex = true): void => {
if (tuiIsCI()) {
return;
}

const isLast = i === total;
const progressLog = `(${i} / ${total}) ${prefix} ${
isLast ? SUCCESS_SYMBOL : message
Expand Down

0 comments on commit 03c2ea5

Please sign in to comment.