File tree 1 file changed +12
-10
lines changed
1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -44,16 +44,6 @@ func TargetTags(files []bake.File) (map[string][]string, error) {
44
44
return nil , err
45
45
}
46
46
47
- var projectName string
48
- path , err := filepath .Abs (files [0 ].Name )
49
- if err != nil {
50
- return nil , err
51
- }
52
- dir := filepath .Base (filepath .Dir (path ))
53
- if dir != "." {
54
- projectName = dir
55
- }
56
-
57
47
details := compose.ConfigDetails {
58
48
ConfigFiles : configFiles ,
59
49
Environment : envs ,
@@ -67,6 +57,18 @@ func TargetTags(files []bake.File) (map[string][]string, error) {
67
57
return nil , err
68
58
}
69
59
60
+ projectName := cfg .Name
61
+ if projectName == "" {
62
+ path , err := filepath .Abs (files [0 ].Name )
63
+ if err != nil {
64
+ return nil , err
65
+ }
66
+ dir := filepath .Base (filepath .Dir (path ))
67
+ if dir != "." {
68
+ projectName = dir
69
+ }
70
+ }
71
+
70
72
targetTags := map [string ][]string {}
71
73
for _ , srv := range cfg .Services {
72
74
if srv .Build == nil {
You can’t perform that action at this time.
0 commit comments