Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

Commit

Permalink
refactor into DatabaseEnginesAsList
Browse files Browse the repository at this point in the history
Signed-off-by: Jason McCallister <jason@craftcms.com>
  • Loading branch information
jasonmccallister committed Oct 2, 2020
1 parent 6430746 commit 33129d1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,24 @@ func (c *Config) SitesAsList() []string {
return s
}

func (c *Config) DatabaseEnginesAsList(engine string) []string {
var dbs []string

for _, db := range c.Databases {
if engine != "" {
if strings.Contains(db.Name(), engine) {
dbs = append(dbs, db.Name())
}

continue
}

dbs = append(dbs, db.Name())
}

return dbs
}

func (c *Config) AddMount(m Mount) error {
// replace the homedir with the tilde
home, err := homedir.Dir()
Expand Down

0 comments on commit 33129d1

Please # to comment.