File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -171,11 +171,24 @@ func runHash(streams api.Streams, opts convertOptions) error {
171
171
if opts .hash != "*" {
172
172
services = append (services , strings .Split (opts .hash , "," )... )
173
173
}
174
- project , err := opts .ToProject (services )
174
+ project , err := opts .ToProject (nil )
175
175
if err != nil {
176
176
return err
177
177
}
178
- for _ , s := range project .Services {
178
+
179
+ if len (services ) > 0 {
180
+ err = withSelectedServicesOnly (project , services )
181
+ if err != nil {
182
+ return err
183
+ }
184
+ }
185
+
186
+ sorted := project .Services
187
+ sort .Slice (sorted , func (i , j int ) bool {
188
+ return sorted [i ].Name < sorted [j ].Name
189
+ })
190
+
191
+ for _ , s := range sorted {
179
192
hash , err := compose .ServiceHash (s )
180
193
if err != nil {
181
194
return err
You can’t perform that action at this time.
0 commit comments