Skip to content

Commit 8b6411c

Browse files
authored
fix: improve cluster list formatting (#119)
* fix: also match non-numeric forms of Up status * chore: add case for Exited status and pass -a flag to docker
1 parent d8c4c90 commit 8b6411c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

  • packages/cluster/src/commands

packages/cluster/src/commands/list.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const getStatus = async cluster =>
1010
cmd: 'docker',
1111
args: [
1212
'ps',
13+
'-a', // Include stopped containers
1314
'--filter',
1415
`name=${makeComposeProject(cluster.name)}_core`,
1516
'--format',
@@ -26,8 +27,10 @@ const formatStatus = status => {
2627
return chalk.grey('Down')
2728
} else if (/\(Paused\)$/.test(status)) {
2829
return chalk.cyan(status)
29-
} else if (/^Up \d+/.test(status)) {
30+
} else if (/^Up/.test(status)) {
3031
return chalk.green(status)
32+
} else if (/^Exited/.test(status)) {
33+
return chalk.red(status)
3134
} else {
3235
return chalk.yellow(status)
3336
}

0 commit comments

Comments
 (0)