forked from toolshed/abra
		
	refactor: formatter gets own package
This commit is contained in:
		@ -5,12 +5,12 @@ import (
 | 
			
		||||
	"os"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/cli/internal"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/autocomplete"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/client"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/config"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/container"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"github.com/docker/docker/api/types"
 | 
			
		||||
	"github.com/docker/docker/api/types/filters"
 | 
			
		||||
	"github.com/docker/docker/pkg/archive"
 | 
			
		||||
 | 
			
		||||
@ -5,9 +5,9 @@ import (
 | 
			
		||||
	"sort"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	abraFormatter "coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/cli/internal"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/config"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/recipe"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/ssh"
 | 
			
		||||
	"coopcloud.tech/tagcmp"
 | 
			
		||||
@ -209,7 +209,7 @@ can take some time.
 | 
			
		||||
				tableCol = append(tableCol, []string{"status", "version", "upgrade"}...)
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			table := abraFormatter.CreateTable(tableCol)
 | 
			
		||||
			table := formatter.CreateTable(tableCol)
 | 
			
		||||
 | 
			
		||||
			for _, appStat := range serverStat.apps {
 | 
			
		||||
				tableRow := []string{appStat.recipe, appStat.appName, appStat.domain}
 | 
			
		||||
 | 
			
		||||
@ -4,14 +4,14 @@ import (
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	abraFormatter "coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/cli/internal"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/autocomplete"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/client"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/config"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	stack "coopcloud.tech/abra/pkg/upstream/stack"
 | 
			
		||||
	"github.com/buger/goterm"
 | 
			
		||||
	"github.com/docker/cli/cli/command/formatter"
 | 
			
		||||
	dockerFormatter "github.com/docker/cli/cli/command/formatter"
 | 
			
		||||
	"github.com/docker/docker/api/types"
 | 
			
		||||
	"github.com/docker/docker/api/types/filters"
 | 
			
		||||
	dockerClient "github.com/docker/docker/client"
 | 
			
		||||
@ -71,7 +71,7 @@ func showPSOutput(c *cli.Context, app config.App, cl *dockerClient.Client) {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	tableCol := []string{"image", "created", "status", "state", "ports"}
 | 
			
		||||
	table := abraFormatter.CreateTable(tableCol)
 | 
			
		||||
	table := formatter.CreateTable(tableCol)
 | 
			
		||||
 | 
			
		||||
	for _, container := range containers {
 | 
			
		||||
		var containerNames []string
 | 
			
		||||
@ -81,11 +81,11 @@ func showPSOutput(c *cli.Context, app config.App, cl *dockerClient.Client) {
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		tableRow := []string{
 | 
			
		||||
			abraFormatter.RemoveSha(container.Image),
 | 
			
		||||
			abraFormatter.HumanDuration(container.Created),
 | 
			
		||||
			formatter.RemoveSha(container.Image),
 | 
			
		||||
			formatter.HumanDuration(container.Created),
 | 
			
		||||
			container.Status,
 | 
			
		||||
			container.State,
 | 
			
		||||
			formatter.DisplayablePorts(container.Ports),
 | 
			
		||||
			dockerFormatter.DisplayablePorts(container.Ports),
 | 
			
		||||
		}
 | 
			
		||||
		table.Append(tableRow)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -6,10 +6,10 @@ import (
 | 
			
		||||
	"os"
 | 
			
		||||
	"strconv"
 | 
			
		||||
 | 
			
		||||
	abraFormatter "coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/cli/internal"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/autocomplete"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/client"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/secret"
 | 
			
		||||
	"github.com/docker/docker/api/types"
 | 
			
		||||
	"github.com/docker/docker/api/types/filters"
 | 
			
		||||
@ -83,7 +83,7 @@ var appSecretGenerateCommand = &cli.Command{
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		tableCol := []string{"name", "value"}
 | 
			
		||||
		table := abraFormatter.CreateTable(tableCol)
 | 
			
		||||
		table := formatter.CreateTable(tableCol)
 | 
			
		||||
		for name, val := range secretVals {
 | 
			
		||||
			table.Append([]string{name, val})
 | 
			
		||||
		}
 | 
			
		||||
@ -215,7 +215,7 @@ var appSecretLsCommand = &cli.Command{
 | 
			
		||||
		secrets := secret.ReadSecretEnvVars(app.Env)
 | 
			
		||||
 | 
			
		||||
		tableCol := []string{"Name", "Version", "Generated Name", "Created On Server"}
 | 
			
		||||
		table := abraFormatter.CreateTable(tableCol)
 | 
			
		||||
		table := formatter.CreateTable(tableCol)
 | 
			
		||||
 | 
			
		||||
		cl, err := client.New(app.Server)
 | 
			
		||||
		if err != nil {
 | 
			
		||||
 | 
			
		||||
@ -3,10 +3,10 @@ package app
 | 
			
		||||
import (
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	abraFormatter "coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/cli/internal"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/autocomplete"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/client"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/recipe"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/upstream/stack"
 | 
			
		||||
	"github.com/docker/distribution/reference"
 | 
			
		||||
@ -81,7 +81,7 @@ Cloud recipe version.
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		tableCol := []string{"version", "service", "image", "digest"}
 | 
			
		||||
		table := abraFormatter.CreateTable(tableCol)
 | 
			
		||||
		table := formatter.CreateTable(tableCol)
 | 
			
		||||
		table.SetAutoMergeCellsByColumnIndex([]int{0})
 | 
			
		||||
 | 
			
		||||
		for serviceName, versionMeta := range versionsMeta {
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,10 @@
 | 
			
		||||
package app
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	abraFormatter "coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/cli/internal"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/autocomplete"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/client"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"github.com/AlecAivazis/survey/v2"
 | 
			
		||||
	"github.com/sirupsen/logrus"
 | 
			
		||||
	"github.com/urfave/cli/v2"
 | 
			
		||||
@ -23,7 +23,7 @@ var appVolumeListCommand = &cli.Command{
 | 
			
		||||
			logrus.Fatal(err)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		table := abraFormatter.CreateTable([]string{"driver", "volume name"})
 | 
			
		||||
		table := formatter.CreateTable([]string{"driver", "volume name"})
 | 
			
		||||
		var volTable [][]string
 | 
			
		||||
		for _, volume := range volumeList {
 | 
			
		||||
			volRow := []string{
 | 
			
		||||
 | 
			
		||||
@ -6,10 +6,10 @@ import (
 | 
			
		||||
	"io/ioutil"
 | 
			
		||||
	"path"
 | 
			
		||||
 | 
			
		||||
	"coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/cli/internal"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/autocomplete"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/config"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	gitPkg "coopcloud.tech/abra/pkg/git"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/limit"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/recipe"
 | 
			
		||||
 | 
			
		||||
@ -4,10 +4,10 @@ import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	abraFormatter "coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/client"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/config"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/dns"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/git"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/lint"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/recipe"
 | 
			
		||||
@ -158,7 +158,7 @@ func DeployAction(c *cli.Context) error {
 | 
			
		||||
// DeployOverview shows a deployment overview
 | 
			
		||||
func DeployOverview(app config.App, version, message string) error {
 | 
			
		||||
	tableCol := []string{"server", "compose", "domain", "app name", "version"}
 | 
			
		||||
	table := abraFormatter.CreateTable(tableCol)
 | 
			
		||||
	table := formatter.CreateTable(tableCol)
 | 
			
		||||
 | 
			
		||||
	deployConfig := "compose.yml"
 | 
			
		||||
	if composeFiles, ok := app.Env["COMPOSE_FILE"]; ok {
 | 
			
		||||
@ -196,7 +196,7 @@ func DeployOverview(app config.App, version, message string) error {
 | 
			
		||||
// NewVersionOverview shows an upgrade or downgrade overview
 | 
			
		||||
func NewVersionOverview(app config.App, currentVersion, newVersion string) error {
 | 
			
		||||
	tableCol := []string{"server", "compose", "domain", "app name", "current version", "to be deployed"}
 | 
			
		||||
	table := abraFormatter.CreateTable(tableCol)
 | 
			
		||||
	table := formatter.CreateTable(tableCol)
 | 
			
		||||
 | 
			
		||||
	deployConfig := "compose.yml"
 | 
			
		||||
	if composeFiles, ok := app.Env["COMPOSE_FILE"]; ok {
 | 
			
		||||
 | 
			
		||||
@ -4,8 +4,8 @@ import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"path"
 | 
			
		||||
 | 
			
		||||
	abraFormatter "coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/config"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/recipe"
 | 
			
		||||
	recipePkg "coopcloud.tech/abra/pkg/recipe"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/secret"
 | 
			
		||||
@ -149,7 +149,7 @@ func NewAction(c *cli.Context) error {
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		secretCols := []string{"Name", "Value"}
 | 
			
		||||
		secretTable := abraFormatter.CreateTable(secretCols)
 | 
			
		||||
		secretTable := formatter.CreateTable(secretCols)
 | 
			
		||||
		for secret := range secrets {
 | 
			
		||||
			secretTable.Append([]string{secret, secrets[secret]})
 | 
			
		||||
		}
 | 
			
		||||
@ -164,7 +164,7 @@ func NewAction(c *cli.Context) error {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	tableCol := []string{"Name", "Domain", "Type", "Server"}
 | 
			
		||||
	table := abraFormatter.CreateTable(tableCol)
 | 
			
		||||
	table := formatter.CreateTable(tableCol)
 | 
			
		||||
	table.Append([]string{sanitisedAppName, Domain, recipe.Name, NewAppServer})
 | 
			
		||||
 | 
			
		||||
	fmt.Println("")
 | 
			
		||||
 | 
			
		||||
@ -3,9 +3,9 @@ package recipe
 | 
			
		||||
import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
 | 
			
		||||
	"coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/cli/internal"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/autocomplete"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/lint"
 | 
			
		||||
	recipePkg "coopcloud.tech/abra/pkg/recipe"
 | 
			
		||||
	"github.com/sirupsen/logrus"
 | 
			
		||||
 | 
			
		||||
@ -6,7 +6,7 @@ import (
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/recipe"
 | 
			
		||||
	"github.com/sirupsen/logrus"
 | 
			
		||||
	"github.com/urfave/cli/v2"
 | 
			
		||||
 | 
			
		||||
@ -6,10 +6,10 @@ import (
 | 
			
		||||
	"strconv"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	abraFormatter "coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/cli/internal"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/autocomplete"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/config"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	gitPkg "coopcloud.tech/abra/pkg/git"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/recipe"
 | 
			
		||||
	recipePkg "coopcloud.tech/abra/pkg/recipe"
 | 
			
		||||
@ -282,7 +282,7 @@ func tagRelease(tagString string, repo *git.Repository) error {
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	hash := abraFormatter.SmallSHA(head.Hash().String())
 | 
			
		||||
	hash := formatter.SmallSHA(head.Hash().String())
 | 
			
		||||
	logrus.Debugf(fmt.Sprintf("created tag %s at %s", tagString, hash))
 | 
			
		||||
 | 
			
		||||
	return nil
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,9 @@
 | 
			
		||||
package recipe
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
	"coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/cli/internal"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/autocomplete"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	recipePkg "coopcloud.tech/abra/pkg/recipe"
 | 
			
		||||
	"github.com/sirupsen/logrus"
 | 
			
		||||
	"github.com/urfave/cli/v2"
 | 
			
		||||
 | 
			
		||||
@ -4,9 +4,9 @@ import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"strconv"
 | 
			
		||||
 | 
			
		||||
	abraFormatter "coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/cli/internal"
 | 
			
		||||
	gandiPkg "coopcloud.tech/abra/pkg/dns/gandi"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"github.com/libdns/gandi"
 | 
			
		||||
	"github.com/sirupsen/logrus"
 | 
			
		||||
	"github.com/urfave/cli/v2"
 | 
			
		||||
@ -55,7 +55,7 @@ are listed. This zone must already be created on your provider account.
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		tableCol := []string{"type", "name", "value", "TTL", "priority"}
 | 
			
		||||
		table := abraFormatter.CreateTable(tableCol)
 | 
			
		||||
		table := formatter.CreateTable(tableCol)
 | 
			
		||||
 | 
			
		||||
		for _, record := range records {
 | 
			
		||||
			value := record.Value
 | 
			
		||||
 | 
			
		||||
@ -4,10 +4,10 @@ import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"strconv"
 | 
			
		||||
 | 
			
		||||
	abraFormatter "coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/cli/internal"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/dns"
 | 
			
		||||
	gandiPkg "coopcloud.tech/abra/pkg/dns/gandi"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"github.com/libdns/gandi"
 | 
			
		||||
	"github.com/libdns/libdns"
 | 
			
		||||
	"github.com/sirupsen/logrus"
 | 
			
		||||
@ -135,7 +135,7 @@ You may also invoke this command in "wizard" mode and be prompted for input
 | 
			
		||||
		createdRecord := createdRecords[0]
 | 
			
		||||
 | 
			
		||||
		tableCol := []string{"type", "name", "value", "TTL", "priority"}
 | 
			
		||||
		table := abraFormatter.CreateTable(tableCol)
 | 
			
		||||
		table := formatter.CreateTable(tableCol)
 | 
			
		||||
 | 
			
		||||
		value := createdRecord.Value
 | 
			
		||||
		if len(createdRecord.Value) > 30 {
 | 
			
		||||
@ -186,7 +186,7 @@ func autoConfigure(c *cli.Context, provider *gandi.Provider, zone string) error
 | 
			
		||||
	records := []libdns.Record{atRecord, wildcardRecord}
 | 
			
		||||
 | 
			
		||||
	tableCol := []string{"type", "name", "value", "TTL", "priority"}
 | 
			
		||||
	table := abraFormatter.CreateTable(tableCol)
 | 
			
		||||
	table := formatter.CreateTable(tableCol)
 | 
			
		||||
 | 
			
		||||
	for _, record := range records {
 | 
			
		||||
		existingRecords, err := provider.GetRecords(c.Context, zone)
 | 
			
		||||
 | 
			
		||||
@ -4,9 +4,9 @@ import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"strconv"
 | 
			
		||||
 | 
			
		||||
	abraFormatter "coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/cli/internal"
 | 
			
		||||
	gandiPkg "coopcloud.tech/abra/pkg/dns/gandi"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"github.com/AlecAivazis/survey/v2"
 | 
			
		||||
	"github.com/libdns/gandi"
 | 
			
		||||
	"github.com/libdns/libdns"
 | 
			
		||||
@ -88,7 +88,7 @@ You may also invoke this command in "wizard" mode and be prompted for input
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		tableCol := []string{"type", "name", "value", "TTL", "priority"}
 | 
			
		||||
		table := abraFormatter.CreateTable(tableCol)
 | 
			
		||||
		table := formatter.CreateTable(tableCol)
 | 
			
		||||
 | 
			
		||||
		value := toDelete.Value
 | 
			
		||||
		if len(toDelete.Value) > 30 {
 | 
			
		||||
 | 
			
		||||
@ -3,9 +3,9 @@ package server
 | 
			
		||||
import (
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/config"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/context"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"github.com/docker/cli/cli/connhelper/ssh"
 | 
			
		||||
	"github.com/sirupsen/logrus"
 | 
			
		||||
	"github.com/urfave/cli/v2"
 | 
			
		||||
 | 
			
		||||
@ -4,8 +4,8 @@ import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/cli/internal"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"coopcloud.tech/libcapsul"
 | 
			
		||||
	"github.com/AlecAivazis/survey/v2"
 | 
			
		||||
	"github.com/hetznercloud/hcloud-go/hcloud"
 | 
			
		||||
 | 
			
		||||
@ -5,10 +5,10 @@ import (
 | 
			
		||||
	"os"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
 | 
			
		||||
	"coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/cli/internal"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/client"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/config"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"github.com/AlecAivazis/survey/v2"
 | 
			
		||||
	"github.com/hetznercloud/hcloud-go/hcloud"
 | 
			
		||||
	"github.com/sirupsen/logrus"
 | 
			
		||||
 | 
			
		||||
@ -8,7 +8,7 @@ import (
 | 
			
		||||
	"path"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/upstream/convert"
 | 
			
		||||
	loader "coopcloud.tech/abra/pkg/upstream/stack"
 | 
			
		||||
	stack "coopcloud.tech/abra/pkg/upstream/stack"
 | 
			
		||||
 | 
			
		||||
@ -5,7 +5,7 @@ import (
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	abraFormatter "coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	"github.com/AlecAivazis/survey/v2"
 | 
			
		||||
	"github.com/docker/docker/api/types"
 | 
			
		||||
	"github.com/docker/docker/api/types/filters"
 | 
			
		||||
@ -33,7 +33,7 @@ func GetContainer(c context.Context, cl *client.Client, filters filters.Args, pr
 | 
			
		||||
		for _, container := range containers {
 | 
			
		||||
			containerName := strings.Join(container.Names, " ")
 | 
			
		||||
			trimmed := strings.TrimPrefix(containerName, "/")
 | 
			
		||||
			created := abraFormatter.HumanDuration(container.Created)
 | 
			
		||||
			created := formatter.HumanDuration(container.Created)
 | 
			
		||||
			containersRaw = append(containersRaw, fmt.Sprintf("%s (created %v)", trimmed, created))
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -10,10 +10,10 @@ import (
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"coopcloud.tech/abra/cli/formatter"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/client"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/compose"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/config"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/formatter"
 | 
			
		||||
	gitPkg "coopcloud.tech/abra/pkg/git"
 | 
			
		||||
	"coopcloud.tech/abra/pkg/upstream/stack"
 | 
			
		||||
	loader "coopcloud.tech/abra/pkg/upstream/stack"
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user