From 6b2c04728cd914f27ae62c1df0bf5df24ac9a628 Mon Sep 17 00:00:00 2001 From: Clawd Date: Tue, 17 Feb 2026 07:54:26 -0800 Subject: Remove v1 code, simplify state to just base_domain - Delete all v1 commands (deploy, init, list, status, remove, etc.) - Delete v1 env/ and host/ subcommand directories - Simplify state.go: remove NextPort, Apps, AllocatePort, etc. - Local state now only tracks default_host + base_domain per host - Ports and deploys are tracked on the server (/etc/ship/ports/) - host init now creates minimal state.json --- cmd/ship/list.go | 61 -------------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 cmd/ship/list.go (limited to 'cmd/ship/list.go') diff --git a/cmd/ship/list.go b/cmd/ship/list.go deleted file mode 100644 index af5baf8..0000000 --- a/cmd/ship/list.go +++ /dev/null @@ -1,61 +0,0 @@ -package main - -import ( - "fmt" - "os" - "text/tabwriter" - - "github.com/bdw/ship/internal/state" - "github.com/spf13/cobra" -) - -var listCmd = &cobra.Command{ - Use: "list", - Short: "List all deployed apps and sites", - RunE: runList, -} - -func runList(cmd *cobra.Command, args []string) error { - st, err := state.Load() - if err != nil { - return fmt.Errorf("error loading state: %w", err) - } - - host := hostFlag - if host == "" { - host = st.GetDefaultHost() - } - - if host == "" { - return fmt.Errorf("--host is required") - } - - apps := st.ListApps(host) - if len(apps) == 0 { - fmt.Printf("No deployments found for %s\n", host) - return nil - } - - w := tabwriter.NewWriter(os.Stdout, 0, 0, 3, ' ', 0) - fmt.Fprintln(w, "NAME\tTYPE\tVISIBILITY\tDOMAIN\tPORT") - for name, app := range apps { - port := "" - if app.Type == "app" || app.Type == "git-app" { - port = fmt.Sprintf(":%d", app.Port) - } - domain := app.Domain - if domain == "" { - domain = "-" - } - visibility := "" - if app.Repo != "" { - visibility = "private" - if app.Public { - visibility = "public" - } - } - fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\n", name, app.Type, visibility, domain, port) - } - w.Flush() - return nil -} -- cgit v1.2.3