From 7ef6c0001af0a74aab6c749e5bb41f0451200676 Mon Sep 17 00:00:00 2001 From: Chris Wiegman Date: Sat, 20 Jan 2024 18:51:52 -0600 Subject: [PATCH] Ensure we always set the correct type, even beyond start --- internal/site/site.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/site/site.go b/internal/site/site.go index 5ae76abf..42d41630 100644 --- a/internal/site/site.go +++ b/internal/site/site.go @@ -58,8 +58,6 @@ func (s *Site) ExportSiteConfig(consoleOutput *console.Console) error { return err } - fmt.Println(localSettings.Environment) - checkCommand := []string{ "option", "get", @@ -168,6 +166,14 @@ func (s *Site) LoadSite( return err } + // Always make sure we set the correct type, even if a config file isn't available. + if cmd.Use != "start" { + s.Settings.Type, err = s.DetectType() + if err != nil { + return err + } + } + // Fail now if we have a command that requires a completed site and we haven't started it before if !isSite && arrayContains(commandsRequiringSite, cmd.Use) { return fmt.Errorf("the current site you are trying to work with does not exist. Use `kana start` to initialize")