Skip to content

Commit 3ae135a

Browse files
committed
feat(cluster-list): add context-path in cluster-list
1 parent 5a1045f commit 3ae135a

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

  • packages/cluster/src/commands

packages/cluster/src/commands/list.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const formatStatus = status => {
3636

3737
const run = async function (argv) {
3838
const clusters = await listClusters(argv)
39-
39+
const anyCustomContext = clusters.some(cluster => cluster.contextPath !== '')
4040
const table = new Table({
4141
head: [
4242
'Name',
@@ -45,20 +45,21 @@ const run = async function (argv) {
4545
'DHIS2 Version',
4646
'DB Version',
4747
'Status',
48-
],
48+
].concat(anyCustomContext ? 'Context Path' : []),
4949
})
5050

5151
await Promise.all(
5252
clusters.map(async cluster => {
5353
const status = await getStatus(cluster)
5454
table.push([
55-
chalk.blue(cluster.name),
56-
cluster.port,
57-
cluster.channel,
58-
cluster.dhis2Version,
59-
cluster.dbVersion,
60-
formatStatus(status),
61-
])
55+
chalk.blue(cluster.name),
56+
cluster.port,
57+
cluster.channel,
58+
cluster.dhis2Version,
59+
cluster.dbVersion,
60+
formatStatus(status),
61+
].concat(anyCustomContext ? cluster.contextPath : [])
62+
)
6263
})
6364
)
6465

0 commit comments

Comments
 (0)