mirror of
https://github.com/docker/compose.git
synced 2025-07-21 12:44:54 +02:00
Merge pull request #1766 from ndeloof/config_profiles
config --profiles to list all defined profiles
This commit is contained in:
commit
1b54a38db3
@ -22,6 +22,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/cnabio/cnab-to-oci/remotes"
|
"github.com/cnabio/cnab-to-oci/remotes"
|
||||||
@ -189,18 +190,23 @@ func runHash(opts convertOptions) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func runProfiles(opts convertOptions, services []string) error {
|
func runProfiles(opts convertOptions, services []string) error {
|
||||||
profiles := map[string]interface{}{}
|
set := map[string]struct{}{}
|
||||||
_, err := opts.toProject(services)
|
project, err := opts.toProject(services)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if opts.projectOptions != nil {
|
for _, s := range project.AllServices() {
|
||||||
for _, p := range opts.projectOptions.Profiles {
|
for _, p := range s.Profiles {
|
||||||
profiles[p] = nil
|
set[p] = struct{}{}
|
||||||
}
|
}
|
||||||
for p := range profiles {
|
}
|
||||||
|
profiles := make([]string, 0, len(set))
|
||||||
|
for p := range set {
|
||||||
|
profiles = append(profiles, p)
|
||||||
|
}
|
||||||
|
sort.Strings(profiles)
|
||||||
|
for _, p := range profiles {
|
||||||
fmt.Println(p)
|
fmt.Println(p)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user