Massive architectural rework
This commit massively overhauls the project's structure to simplify development. Most parts are now correctly compartmentalized and dependencies are passed in a sane way rather than global variables galore xd.
This commit is contained in:
26
cmd/cli/commands/list.go
Normal file
26
cmd/cli/commands/list.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
util "github.com/juls0730/flux/internal/util/cli"
|
||||
"github.com/juls0730/flux/pkg/API"
|
||||
)
|
||||
|
||||
func ListCommand(ctx CommandCtx, args []string) error {
|
||||
apps, err := util.GetRequest[[]API.App](ctx.Config.DaemonURL + "/apps")
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get apps: %v", err)
|
||||
}
|
||||
|
||||
if len(*apps) == 0 {
|
||||
fmt.Println("No apps found")
|
||||
return nil
|
||||
}
|
||||
|
||||
for _, app := range *apps {
|
||||
fmt.Printf("%s (%s)\n", app.Name, app.DeploymentStatus)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user