in src/commands/deploy/index.ts [266:303]
export async function displayVersionList(
versionList: CodeVersionProps[],
stagingVersion = 'unstable',
productionVersion = 'unstable'
) {
logger.log(
`${chalk.bgYellow('Active')} ${t('deploy_env_staging').d('Staging')}`
);
logger.log(
`${chalk.bgGreen('Active')} ${t('deploy_env_production').d('Production')}`
);
const data: string[][] = [];
for (let i = 0; i < versionList.length; i++) {
const version = versionList[i];
const createTime = moment(version.CreateTime).format('YYYY/MM/DD HH:mm:ss');
const tags = [
version.CodeVersion === stagingVersion ? chalk.bgYellow('Active') : '',
version.CodeVersion === productionVersion ? chalk.bgGreen('Active') : ''
];
data.push([
`${version.CodeVersion} ${tags.join(' ')}`,
createTime,
Base64.decode(version.CodeDescription)
]);
}
logger.table(
[
t('deploy_table_header_version').d('Version'),
t('deploy_table_header_created').d('Created'),
t('deploy_table_header_description').d('Description')
],
data,
[25, 25, 15]
);
}