Skip to content

Commit

Permalink
feat(plugin-composer): 支持在 CI 环境下打印更多的集成信息 (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
lyfeyaj authored Aug 1, 2023
1 parent 3ac4fd4 commit 9b70c32
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/plugin-composer/src/compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
MODULE_MODE_NAMES,
MODULE_TYPE_NAMES
} from './constants'
import { isCIENV } from './utils'

const {
pick,
Expand Down Expand Up @@ -1154,7 +1155,7 @@ function logHostAndModulesInfos(
'类型',
'模式'
]
colWidths = [46, 16, 6, 6]
colWidths = isCIENV() ? [56, 30, 6, 6] : [46, 16, 6, 6]
} else {
logger.info('模块集成结果:')
head = [
Expand All @@ -1164,7 +1165,7 @@ function logHostAndModulesInfos(
'模式',
'结果'
]
colWidths = [46, 16, 6, 6, 6]
colWidths = isCIENV() ? [56, 30, 6, 6, 6] : [46, 16, 6, 6, 6]
}

const table = {
Expand Down
7 changes: 7 additions & 0 deletions packages/plugin-composer/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,10 @@ export function overrideUserConfig<T = Record<string, any>>({

return userConfig
}

/**
* 判断是否为 CI 环境
*/
export function isCIENV() {
return Boolean(process.env.CI || process.env.CLOUDBUILD)
}

0 comments on commit 9b70c32

Please sign in to comment.