refactor(ps)!: remove -w, "watch ..." does it better

This commit is contained in:
2024-07-08 01:10:58 +02:00
parent 1a8dca9804
commit 96a25425a4
3 changed files with 2 additions and 18 deletions

View File

@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
"time"
"coopcloud.tech/abra/cli/internal"
appPkg "coopcloud.tech/abra/pkg/app"
@ -15,7 +14,6 @@ import (
"coopcloud.tech/abra/pkg/recipe"
abraService "coopcloud.tech/abra/pkg/service"
stack "coopcloud.tech/abra/pkg/upstream/stack"
"github.com/buger/goterm"
dockerFormatter "github.com/docker/cli/cli/command/formatter"
containerTypes "github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
@ -31,7 +29,6 @@ var appPsCommand = cli.Command{
Description: "Show status of a deployed app.",
Flags: []cli.Flag{
internal.MachineReadableFlag,
internal.WatchFlag,
internal.DebugFlag,
},
Before: internal.SubCommandBefore,
@ -62,18 +59,9 @@ var appPsCommand = cli.Command{
}
}
if !internal.Watch {
showPSOutput(app, cl)
return nil
}
showPSOutput(app, cl)
goterm.Clear()
for {
goterm.MoveCursor(1, 1)
showPSOutput(app, cl)
goterm.Flush()
time.Sleep(2 * time.Second)
}
return nil
},
}