From b5d97f633c960a826577fd80cb1d29e392dce34b Mon Sep 17 00:00:00 2001 From: bndw Date: Fri, 23 Jan 2026 21:10:04 -0800 Subject: Move default host from config file to state.json Instead of a separate ~/.config/deploy/config file, the default host is now stored as default_host in state.json. This simplifies the config and keeps all state in one place. The init command now automatically sets the default host if none is configured. --- cmd/deploy/deploy.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'cmd/deploy/deploy.go') diff --git a/cmd/deploy/deploy.go b/cmd/deploy/deploy.go index 2b3ab4a..ee7ee4a 100644 --- a/cmd/deploy/deploy.go +++ b/cmd/deploy/deploy.go @@ -9,7 +9,6 @@ import ( "strconv" "strings" - "github.com/bdw/deploy/internal/config" "github.com/bdw/deploy/internal/ssh" "github.com/bdw/deploy/internal/state" "github.com/bdw/deploy/internal/templates" @@ -55,14 +54,14 @@ func runDeploy(args []string) { fs.Parse(args) - // Get host from flag or config + // Get host from flag or state default if *host == "" { - cfg, err := config.Load() + st, err := state.Load() if err != nil { - fmt.Fprintf(os.Stderr, "Error loading config: %v\n", err) + fmt.Fprintf(os.Stderr, "Error loading state: %v\n", err) os.Exit(1) } - *host = cfg.Host + *host = st.GetDefaultHost() } if *host == "" || *domain == "" { -- cgit v1.2.3