From 4daacb00fe6205c6ceb681d8d942740ac4f288b3 Mon Sep 17 00:00:00 2001 From: Aleksander Cynarski Date: Tue, 28 Nov 2023 20:45:16 +0100 Subject: [PATCH] add logs to docker up command --- .gitignore | 1 + app/cmd/container/up.go | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index 27bb586..7e804ad 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ dist main ledo .ledo-back.yml +.scannerwork diff --git a/app/cmd/container/up.go b/app/cmd/container/up.go index 7abec0e..ff57002 100644 --- a/app/cmd/container/up.go +++ b/app/cmd/container/up.go @@ -24,6 +24,12 @@ var CmdDockerUp = cli.Command{ Usage: "build local images before run", Required: false, }, + &cli.BoolFlag{ + Name: "logs", + Aliases: []string{"l"}, + Usage: "show logs after up", + Required: false, + }, }, } @@ -33,5 +39,8 @@ func RunComposeUp(cmd *cli.Context) error { compose.ExecComposerBuild(ctx, *cmd) } compose.ExecComposerUp(ctx, cmd.Bool("no-detach")) + if cmd.Bool("logs") { + compose.ExecComposerLogs(ctx, cmd.Args()) + } return nil }