Skip to content

Commit

Permalink
Ensure we always set the correct type, even beyond start
Browse files Browse the repository at this point in the history
ChrisWiegman committed Jan 21, 2024

Unverified

This user has not yet uploaded their public signing key.
1 parent 5f0ebca commit 7ef6c00
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions internal/site/site.go
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit 7ef6c00

Please sign in to comment.