From 748ba3e368db095d500ad7696cf20ac171f1aa5a Mon Sep 17 00:00:00 2001 From: Daniel Bulant Date: Tue, 30 Nov 2021 21:00:04 +0100 Subject: [PATCH 1/2] Fix skipping first container in ps command --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index ca1176a3..6f3dcba5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -82,7 +82,7 @@ export const mapPsOutput = (output: string): DockerComposePsResult => { const services = output .split(`\n`) .filter(nonEmptyString) - .filter((_, index) => index > 1) + .filter((_, index) => index > 0) .map((line) => { const [ nameFragment, From 18a9079ee64b39caae0f08e1d6f14a274211a091 Mon Sep 17 00:00:00 2001 From: Daniel Bulant Date: Tue, 30 Nov 2021 21:05:59 +0100 Subject: [PATCH 2/2] Add service --- src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.ts b/src/index.ts index 6f3dcba5..c7b86c5c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -87,6 +87,7 @@ export const mapPsOutput = (output: string): DockerComposePsResult => { const [ nameFragment, commandFragment, + serviceFragment, stateFragment, untypedPortsFragment ] = line.split(/\s{3,}/) @@ -94,6 +95,7 @@ export const mapPsOutput = (output: string): DockerComposePsResult => { return { name: nameFragment.trim(), command: commandFragment.trim(), + service: serviceFragment.trim(), state: stateFragment.trim(), ports: mapPorts(untypedPortsFragment.trim()) }