Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion pkg/action/create_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ func (i *CreateInstance) Run() (*instance.CreateSiteWhereInstance, error) {
if i.ConfigurationTemplate == "" {
i.ConfigurationTemplate = defaultConfigurationTemplate
}
if i.Minimal {
if i.Debug {
prof = profile.Debug
} else if i.Minimal {
prof = profile.Minimal
i.ConfigurationTemplate = "minimal"
}
Expand Down
15 changes: 12 additions & 3 deletions pkg/action/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ package action
import (
"context"
"fmt"
"github.com/sitewhere/swctl/pkg/install/profile"
"io/ioutil"
"log"
"os"
Expand All @@ -28,6 +27,8 @@ import (
"sync"
"time"

"github.com/sitewhere/swctl/pkg/install/profile"

"gopkg.in/yaml.v2"

"github.com/gofrs/flock"
Expand Down Expand Up @@ -122,8 +123,13 @@ func (i *Install) Run() (*install.SiteWhereInstall, error) {

// ConfigurationExists check for swctl configuration file
func (i *Install) ConfigurationExists() bool {
_, err := config.LoadConfigurationTemplate(&config.PlaceHolder{}, profile.Default)
return err != config.ErrNotFound
for _, p := range profile.All {
_, err := config.LoadConfigurationTemplate(&config.PlaceHolder{}, p)
if err == config.ErrNotFound {
return false
}
}
return true
}

// CreateConfiguration Loads the default and minimal configuration
Expand All @@ -133,6 +139,9 @@ func (i *Install) CreateConfiguration() error {
if err = config.CreateMinimalConfiguration(); err != nil {
return err
}
if err = config.CreateDebugConfiguration(); err != nil {
return err
}
return config.CreateDefaultConfiguration()
}

Expand Down
Loading