Skip to content

Commit

Permalink
Merge pull request #3 from ElmCompany/8994-convert-built-images
Browse files Browse the repository at this point in the history
refactor(config): introduce --images-to-build
  • Loading branch information
abdennour authored Dec 17, 2021
2 parents 114e51d + 7020503 commit 5b75d18
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/compose/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type convertOptions struct {
profiles bool
images bool
hash string
builtImages bool
imagesToBuild bool
}

func convertCommand(p *projectOptions, backend api.Service) *cobra.Command {
Expand Down Expand Up @@ -87,7 +87,7 @@ func convertCommand(p *projectOptions, backend api.Service) *cobra.Command {
if opts.profiles {
return runProfiles(opts, args)
}
if opts.images || opts.builtImages {
if opts.images || opts.imagesToBuild {
return runConfigImages(opts, args)
}

Expand All @@ -106,7 +106,7 @@ func convertCommand(p *projectOptions, backend api.Service) *cobra.Command {
flags.BoolVar(&opts.volumes, "volumes", false, "Print the volume names, one per line.")
flags.BoolVar(&opts.profiles, "profiles", false, "Print the profile names, one per line.")
flags.BoolVar(&opts.images, "images", false, "Print the image names, one per line.")
flags.BoolVar(&opts.builtImages, "built-images", false, "Print only built image names, one per line")
flags.BoolVar(&opts.imagesToBuild, "images-to-build", false, "Print only built image names, one per line")
flags.StringVar(&opts.hash, "hash", "", "Print the service config hash, one per line.")
flags.StringVarP(&opts.Output, "output", "o", "", "Save to file (default to stdout)")

Expand Down Expand Up @@ -229,7 +229,7 @@ func runConfigImages(opts convertOptions, services []string) error {
return err
}
for _, s := range project.Services {
if !opts.builtImages || (opts.builtImages && s.Build != nil) {
if !opts.imagesToBuild || (opts.imagesToBuild && s.Build != nil) {
fmt.Println(getImageName(s, *project))
}
}
Expand Down

0 comments on commit 5b75d18

Please sign in to comment.